forked from w1ne/labwired-core
-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (205 loc) · 8.09 KB
/
Copy pathcore-coverage-matrix-smoke.yml
File metadata and controls
227 lines (205 loc) · 8.09 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: Core Coverage Matrix Smoke
on:
# Slow gates: nightly + main tip + manual. Not on PRs (PR merge target <1 min).
schedule:
- cron: "0 2 * * *"
push:
branches:
- main
paths:
- "configs/chips/**"
- "configs/systems/**"
- "examples/**"
- "crates/core/**"
- "crates/cli/**"
- "crates/labwired-models-**"
- ".github/workflows/core-coverage-matrix-smoke.yml"
workflow_dispatch:
concurrency:
group: core-coverage-matrix-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
coverage-matrix-smoke:
name: coverage-matrix-${{ matrix.id }}
runs-on: ubuntu-latest
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
include:
- id: ci-fixture-armv6m
target: thumbv6m-none-eabi
crate: firmware-ci-fixture
profile: release
profile_dir: release
script: examples/ci/uart-ok.yaml
system: configs/systems/ci-fixture-uart1.yaml
- id: riscv-ci-fixture
target: riscv32i-unknown-none-elf
crate: riscv-ci-fixture
profile: release
profile_dir: release
script: examples/ci/riscv-uart-ok.yaml
system: configs/systems/ci-fixture-riscv-uart1.yaml
- id: demo-blinky-stm32f103
target: thumbv7m-none-eabi
crate: demo-blinky
profile: release
profile_dir: release
script: examples/demo-blinky/io-smoke.yaml
system: examples/demo-blinky/system.yaml
- id: stm32h563-nucleo
target: thumbv7m-none-eabi
crate: firmware-h563-demo
profile: release
profile_dir: release
script: examples/nucleo-h563zi/uart-smoke.yaml
system: examples/nucleo-h563zi/system.yaml
- id: stm32f401cdu6
target: thumbv7em-none-eabi
crate: firmware-f401-demo
profile: release
profile_dir: release
script: examples/stm32f401cdu6/uart-smoke.yaml
system: configs/systems/stm32f401cdu6.yaml
# Note: demo-blinky-stm32f103 already covers F103 bluepill + same ELF;
# a second identical cell was removed (CI roast 2026-07-23).
- id: canmod-gps-sim
make: examples/canmod-gps-sim/firmware
script: examples/canmod-gps-sim/canmod-smoke.yaml
system: examples/canmod-gps-sim/system.yaml
- id: f103-j1939-monitor
make: examples/f103-j1939-monitor/firmware
script: examples/f103-j1939-monitor/j1939-replay.yaml
system: examples/f103-j1939-monitor/replay-system.yaml
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@1.95.0
with:
targets: thumbv6m-none-eabi,thumbv7m-none-eabi,thumbv7em-none-eabi,riscv32i-unknown-none-elf
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
shared-key: core-coverage-matrix
workspaces: |
. -> target
- name: Build CLI (release — matches local matrix / fidelity path)
run: cargo build -p labwired-cli --release
- name: Install C cross toolchain
if: matrix.make != ''
run: |
sudo apt-get update -qq
sudo apt-get install -y gcc-arm-none-eabi
- name: Build C firmware
if: matrix.make != ''
run: make -C ${{ matrix.make }}
- name: Build matrix firmware
if: matrix.crate != ''
run: |
if [ "${{ matrix.profile }}" = "release" ]; then
cargo build -p "${{ matrix.crate }}" --release --target "${{ matrix.target }}"
else
cargo build -p "${{ matrix.crate }}" --target "${{ matrix.target }}"
fi
- name: Run matrix smoke
run: |
mkdir -p "out/coverage-matrix/${{ matrix.id }}"
./target/release/labwired test \
--script "${{ matrix.script }}" \
--output-dir "out/coverage-matrix/${{ matrix.id }}" \
--no-uart-stdout
- name: Verify frames against CSS's real DBC
if: matrix.id == 'canmod-gps-sim'
run: |
python3 -m pip install --quiet cantools
python3 "$(dirname "${{ matrix.script }}")/decode_check.py" \
"out/coverage-matrix/${{ matrix.id }}/uart.log"
- name: Run unsupported-instruction audit
if: matrix.crate != ''
run: |
./scripts/unsupported_instruction_audit.sh \
--firmware "target/${{ matrix.target }}/${{ matrix.profile_dir }}/${{ matrix.crate }}" \
--system "${{ matrix.system }}" \
--max-steps 20000 \
--out-dir "out/coverage-matrix/${{ matrix.id }}/unsupported-audit"
- name: Publish audit summary
if: matrix.crate != ''
run: |
python3 - <<'PY' >> "$GITHUB_STEP_SUMMARY"
import json
from pathlib import Path
metrics = Path("out/coverage-matrix/${{ matrix.id }}/unsupported-audit/metrics.json")
if not metrics.exists():
print("### Coverage Matrix Audit: ${{ matrix.id }}")
print("")
print("- metrics: missing")
else:
data = json.loads(metrics.read_text())
print("### Coverage Matrix Audit: ${{ matrix.id }}")
print("")
print(f"- instructions executed: `{data.get('instructions_executed', 0)}`")
print(f"- unsupported observations: `{data.get('unsupported_total', 0)}`")
print(f"- instruction support coverage: `{data.get('instruction_support_percent', 0)}%`")
PY
- name: Upload matrix artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-matrix-${{ matrix.id }}
path: out/coverage-matrix/${{ matrix.id }}/
retention-days: 14
coverage-matrix-scoreboard:
name: coverage-matrix-scoreboard
runs-on: ubuntu-latest
timeout-minutes: 5
needs: coverage-matrix-smoke
if: always()
steps:
- uses: actions/checkout@v4
- name: Download matrix artifacts
uses: actions/download-artifact@v4
with:
path: out/coverage-matrix
pattern: coverage-matrix-*
merge-multiple: false
- name: Generate scoreboard
run: |
python3 scripts/generate_coverage_matrix_scoreboard.py \
--matrix-root out/coverage-matrix \
--markdown-out out/coverage-matrix/scoreboard.md \
--json-out out/coverage-matrix/scoreboard.json \
--required-target stm32h563-nucleo \
--required-target stm32f401cdu6 \
--required-target riscv-ci-fixture \
--required-target demo-blinky-stm32f103 \
--required-target f103-j1939-monitor \
--required-target canmod-gps-sim \
--required-target ci-fixture-armv6m \
--min-required-pass-rate 1.0
- name: Publish scoreboard summary
run: |
cat out/coverage-matrix/scoreboard.md >> "$GITHUB_STEP_SUMMARY"
- name: Enforce required targets (100% pass — no soft loophole)
run: |
python3 scripts/generate_coverage_matrix_scoreboard.py \
--matrix-root out/coverage-matrix \
--markdown-out /tmp/coverage-matrix-gate.md \
--json-out /tmp/coverage-matrix-gate.json \
--required-target stm32h563-nucleo \
--required-target stm32f401cdu6 \
--required-target riscv-ci-fixture \
--required-target demo-blinky-stm32f103 \
--required-target f103-j1939-monitor \
--required-target canmod-gps-sim \
--required-target ci-fixture-armv6m \
--min-required-pass-rate 1.0
- name: Upload scoreboard artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-matrix-scoreboard
path: |
out/coverage-matrix/scoreboard.md
out/coverage-matrix/scoreboard.json
retention-days: 14