Commit 1d8f66b
committed
ci: make per-package test matrix respect detect-changes
The `test` job's matrix used `package: ${{ fromJson(detect-changes) }}`
as the base plus a static `include:` block listing all 7 packages with
their per-package flags. Because GitHub Actions spawns a NEW matrix
combination for any `include:` entry whose `package` can't be merged
into the base (it would overwrite `package`), every package was
re-added as its own job on every PR — `detect-changes` shrunk the base
matrix but the `include` block immediately re-expanded it to all 7
packages. `Test wasm-privacy-coin` (and every other `Test <pkg>`) ran
on every PR regardless of what changed.
Move the per-package flags into `detect-changes.mjs`, which now emits
an array of objects [{package, needs-wasm-pack, has-wasm-pack-tests}]
filtered to changed packages, and consume it with
`matrix.include: ${{ fromJson(...) }}` (no base `package:` key, no
static list). Now only changed packages — plus the shared-infra and
empty-diff fallbacks, which return all packages — become test jobs.
Verified locally: for a PR touching only packages/wasm-utxo/,
detect-changes emits a single entry and the matrix would spawn only
`Test wasm-utxo` instead of all 7 `Test *` jobs.
The stable `test / Test` gate job (needs build/test/finalize) remains
the branch-protection check, and the non-PR / shared-infra / no-op
fallbacks keep the matrix non-empty so the gate is never skipped.1 parent c744b64 commit 1d8f66b
2 files changed
Lines changed: 49 additions & 37 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
6 | 23 | | |
7 | | - | |
8 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
9 | 28 | | |
10 | 29 | | |
11 | 30 | | |
12 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
13 | 37 | | |
14 | | - | |
15 | | - | |
| 38 | + | |
| 39 | + | |
16 | 40 | | |
17 | 41 | | |
18 | 42 | | |
19 | 43 | | |
20 | 44 | | |
21 | 45 | | |
22 | 46 | | |
23 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
24 | 51 | | |
25 | 52 | | |
26 | | - | |
27 | | - | |
| 53 | + | |
| 54 | + | |
28 | 55 | | |
29 | 56 | | |
30 | | - | |
| 57 | + | |
31 | 58 | | |
32 | 59 | | |
33 | 60 | | |
34 | 61 | | |
35 | | - | |
36 | | - | |
| 62 | + | |
| 63 | + | |
37 | 64 | | |
38 | | - | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
181 | 166 | | |
182 | 167 | | |
183 | 168 | | |
| |||
0 commit comments