-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (113 loc) · 4.45 KB
/
Copy pathci.yml
File metadata and controls
141 lines (113 loc) · 4.45 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test and typecheck
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Shell syntax
run: |
for script in scripts/proxmox/inkpanel-lxc.sh scripts/proxmox/files/inkpanel-update scripts/build-firmware.sh scripts/compile-mini-firmware.sh scripts/firmware-input-hash.sh; do
echo "checking $script"
bash -n "$script"
done
node --check scripts/proxmox/files/write-status.mjs
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install Chromium
run: npx playwright install --with-deps chromium
- name: Typecheck
run: npm run check
- name: Test
run: npm test
- name: Test across server timezones
run: npm run test:tz
firmware:
name: Compile InkPanel firmware targets
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v2
- name: Cache Arduino ESP32 core
uses: actions/cache@v4
with:
path: ~/.arduino15
key: arduino-esp32-${{ runner.os }}-v1
- name: Install ESP32 board core
run: |
arduino-cli config init --overwrite --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core update-index
arduino-cli core install esp32:esp32
- name: Build production firmware packages
run: ./scripts/build-firmware.sh
- name: Build Mini hardware validation artifact
env:
MINI_ARTIFACT_DIR: ${{ github.workspace }}/firmware/mini-validation-artifact
run: bash scripts/compile-mini-firmware.sh
- name: Check published full-size and Mini firmware outputs
run: |
test -s firmware/dist/manifest.json
test -s firmware/dist/input.sha256
test -n "$(find firmware/dist -maxdepth 1 -name '*.bin' -type f -size +0c -print -quit)"
test -s firmware/dist/mini/manifest.json
test -n "$(find firmware/dist/mini -maxdepth 1 -name '*.bin' -type f -size +0c -print -quit)"
test "$(node -e "const m=require('./firmware/dist/manifest.json'); process.stdout.write(m.target)")" = "full"
test "$(node -e "const m=require('./firmware/dist/mini/manifest.json'); process.stdout.write(m.target)")" = "mini"
test "$(cat firmware/dist/input.sha256)" = "$(bash scripts/firmware-input-hash.sh)"
- name: Check Mini validation package
run: |
test -s firmware/mini-validation-artifact/README_FIRST.txt
test -s firmware/mini-validation-artifact/arduino/inkpanel/inkpanel.ino
test -s firmware/mini-validation-artifact/arduino/inkpanel/MiniEPD.cpp
test -s firmware/mini-validation-artifact/driver-test/InkPanelMiniDriverTest/InkPanelMiniDriverTest.ino
test -n "$(find firmware/mini-validation-artifact/binaries -maxdepth 1 -name '*.merged.bin' -type f -size +0c -print -quit)"
- name: Upload Mini hardware validation package
uses: actions/upload-artifact@v4
with:
name: inkpanel-mini-hardware-validation
path: |
firmware/mini-validation-artifact/
!firmware/mini-validation-artifact/**/build/**
if-no-files-found: error
retention-days: 14
golden:
name: Generate golden reference
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npx playwright install --with-deps chromium
- name: Render golden
run: UPDATE_GOLDENS=1 npm test
- uses: actions/upload-artifact@v4
with:
name: golden-linux
path: test/fixtures/golden/
if-no-files-found: error