Repository navigation
168 lines (160 loc) · 5.6 KB
/
Copy pathci.yml
File metadata and controls
168 lines (160 loc) · 5.6 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
workflow_dispatch:
# Keep a single run per ref so cached PlatformIO state cannot race.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
validate-coverage:
name: Validate Test Registration
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Validate test registration and build matrix
run: node scripts/validate-test-coverage.js
regression-tests:
name: Host and Native Regression
runs-on: ubuntu-latest
needs: validate-coverage
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Install dependencies
run: |
npm ci
python -m pip install --upgrade pip
pip install platformio littlefs-python==0.19.0
npm ci --prefix test/browser
npx --prefix test/browser playwright install --with-deps chromium
- name: Run host and native regressions
run: npm run test:regression
- name: Validate PowerShell scripts
shell: pwsh
run: ./scripts/validate-powershell-syntax.ps1
browser-test-collection:
name: Browser Tests
runs-on: ubuntu-latest
needs: validate-coverage
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install browser test dependencies
run: npm ci --prefix test/browser
- name: Parse all Playwright tests without contacting a device
run: npm run test:e2e:collect
- name: Install Chromium for offline UI regression
run: npx --prefix test/browser playwright install --with-deps chromium
- name: Run deterministic offline UI regression
run: npm run test:e2e:offline
firmware-build:
name: Firmware Build (${{ matrix.environment }})
runs-on: ubuntu-latest
needs: validate-coverage
strategy:
fail-fast: false
matrix:
environment:
- esp32-F4R0
- esp32-F8R0
- esp32-F8R8
- esp32c3-F4R0
- esp32c6-F4R0
- esp32c6-F8R0
- esp32s3-F8R0
- esp32s3-F8R8
- esp32s3-F16R8
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
${{ runner.os }}-pio-
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Remove stale environment output
run: |
rm -rf -- ".pio/build/${{ matrix.environment }}"
rm -rf -- "dist/firmware/${{ matrix.environment }}"
- name: Build firmware
run: pio run -e ${{ matrix.environment }}
- name: Build LittleFS image
run: pio run -e ${{ matrix.environment }} --target buildfs
- name: Validate current build artifacts
run: node scripts/test-build-artifacts.js --env=${{ matrix.environment }} --current-build
- name: Upload complete firmware artifacts
uses: actions/upload-artifact@v4
with:
name: firmware-${{ matrix.environment }}
path: dist/firmware/${{ matrix.environment }}/
if-no-files-found: error
retention-days: 14
web-build:
name: Web Module Build
runs-on: ubuntu-latest
needs: validate-coverage
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache Node Modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Verify compile-capability Web selection
run: |
node scripts/test-web-profile.js
node scripts/test-web-capability-build.js
- name: Build gzip-only Web and LittleFS staging assets
run: node scripts/gzip-www.js --no-upload --no-monitor --env=esp32s3-F16R8 --stage-dir=.pio/ci-fs-stage
- name: Verify gzip-only LittleFS staging
run: |
test -f data/www/index.html.gz
test -f data/www/js/chunk-1-core.js.gz
test -f data/www/js/chunk-2-app.js.gz
test -f data/www/js/chunk-3-state.js.gz
test -f data/www/js/modules/dashboard-fullscreen.js.gz
test -f .pio/ci-fs-stage/www/index.html.gz
test "$(find data/www -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' \) | wc -l)" -eq 0
test "$(find .pio/ci-fs-stage/www -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' \) | wc -l)" -eq 0
node scripts/test-web-quality-gate.js
node scripts/web-smoke-test.js
node scripts/test-gzip-www-contract.js --stage-dir=.pio/ci-fs-stage
# Live E2E checks require explicit STA addresses and are intentionally manual.