-
Notifications
You must be signed in to change notification settings - Fork 7
116 lines (104 loc) · 3.57 KB
/
main.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---
name: CI
# yamllint disable-line rule:truthy
on:
push:
branches: [main, dev, beta, release]
pull_request:
merge_group:
permissions:
contents: read
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ci:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- id: test
file: tests/test.esp32_ard.notime.yaml
name: Test tests/test.esp32_ard.notime.yaml
pio_cache_key: test.esp32_ard.notime
- id: test
file: tests/test.esp32_ard.uart.yaml
name: Test tests/test.esp32_ard.uart.yaml
pio_cache_key: test.esp32_ard.uart
- id: test
file: tests/test.esp32_ard.vv_log.yaml
name: Test tests/test.esp32_ard.vv_log.yaml
pio_cache_key: test.esp32_ard.vv_log
- id: test
file: tests/test.esp32_ard.yaml
name: Test tests/test.esp32_ard.yaml
pio_cache_key: test.esp32_ard
- id: test
file: tests/test.esp32_idf.uart.yaml
name: Test tests/test.esp32_idf.uart.yaml
pio_cache_key: test.esp32_idf.uart
- id: test
file: tests/test.esp32_idf.yaml
name: Test tests/test.esp32_idf.yaml
pio_cache_key: test.esp32_idf
- id: test
file: tests/test.rp2040.uart.yaml
name: Test tests/test.rp2040.uart.yaml
pio_cache_key: test.rp2040.uart
- id: test
file: tests/test.rp2040.yaml
name: Test tests/test.rp2040.yaml
pio_cache_key: test.rp2040
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
id: python
with:
python-version: "3.9"
- name: Cache virtualenv
uses: actions/cache@v3
with:
path: .venv
# yamllint disable-line rule:line-length
key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }}
restore-keys: |
venv-${{ steps.python.outputs.python-version }}-
- name: Set up virtualenv
# yamllint disable rule:line-length
run: |
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install esphome
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
# yamllint enable rule:line-length
# Use per check platformio cache because checks use different parts
- name: Cache platformio
uses: actions/cache@v3
with:
path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
if: matrix.id == 'test' || matrix.id == 'clang-tidy'
- run: esphome compile ${{ matrix.file }}
if: matrix.id == 'test'
env:
# Also cache libdeps, store them in a ~/.platformio subfolder
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
ci-status:
name: CI Status
runs-on: ubuntu-latest
needs: [ci]
if: always()
steps:
- name: Successful deploy
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing deploy
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1