-
Notifications
You must be signed in to change notification settings - Fork 14
69 lines (59 loc) · 1.7 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
name: CI
# yamllint disable-line rule:truthy
on:
push:
pull_request:
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
env:
ESPHOME_VERSION: 2024.9.0
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- id: cache
name: Cache
uses: actions/cache@v4
with:
path: |
~/.platformio
.venv
key: esphome-${{ env.ESPHOME_VERSION }}
- name: Set up virtualenv
run: |
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install esphome==${{ env.ESPHOME_VERSION }} yamllint pylint
if: steps.cache.outputs.cache-hit != 'true'
- name: Init virtualenv
run: |
source .venv/bin/activate
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
- name: Run yamllint
run: |
yamllint $(git ls-files '*.yaml')
- name: Run pylint
run: |
pylint $(git ls-files '*.py')
- name: Run clang-format
run: |
clang-format --dry-run --Werror $(git ls-files '*.cpp' '*.h')
- name: Compile configs
run: |
for f in configs/*-example-config.yaml
do
sed 's!github://stas-sl/esphome-sound-level-meter!../components!' -i $f
esphome compile $f
done