summaryrefslogtreecommitdiff
path: root/.github/workflows/build_util.yml
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2026-07-30 02:29:32 +0700
committerGitHub <[email protected]>2026-07-30 02:29:32 +0700
commiteef5af86aa26fe3d72e41156a586a6ed3ffce9f8 (patch)
treefa5ebe3a8d46738338eaee2d4a80717a7a10f464 /.github/workflows/build_util.yml
parent5d8afbb23248e9d1d5d1fdf434c9c58cc54ba5b7 (diff)
hil, ci: scope HIL builds and tests to the boards a PR affects (#3797)
hil, ci: scope HIL builds and tests to the boards a PR affects Add test/hil/hil_select.py, a stdlib-only selector that maps a PR diff to the rig boards, tests and BSP families a change can affect, and wire it into CI so pull requests build and run only those. A port change picks its families' boards, a class change picks the examples enabling that class, and device/host changes prune the other role. Anything unclassified — infra, an unmapped port, a selector error — falls back to the full matrix, and push/schedule runs are untouched. Move the shared example lists to hil_examples.py; 54 hardware-free tests cover the rules.
Diffstat (limited to '.github/workflows/build_util.yml')
-rw-r--r--.github/workflows/build_util.yml15
1 files changed, 15 insertions, 0 deletions
diff --git a/.github/workflows/build_util.yml b/.github/workflows/build_util.yml
index 90115862b..02f16488a 100644
--- a/.github/workflows/build_util.yml
+++ b/.github/workflows/build_util.yml
@@ -39,6 +39,21 @@ on:
jobs:
family:
+ # PR-scoped HIL selection can produce an empty build-args list for a toolchain
+ # (e.g. a dwc2-only change with no riscv boards affected); an empty matrix
+ # vector fails the job outright ("Matrix vector 'arg' does not contain any
+ # values"), so skip cleanly instead.
+ #
+ # Why that is safe for callers: GitHub SKIPS the dependents of a skipped
+ # `needs:` job, so this only works because the caller (hil-build) is itself a
+ # *matrix* job - a matrix with one skipped leg and one successful leg
+ # aggregates to success, and its dependents run.
+ #
+ # NOT covered: if every leg is empty the whole caller job skips, and so does
+ # everything that needs it. That is fine only because an all-empty selection
+ # means no board was selected for those rigs, so the rig jobs would have had
+ # nothing to run anyway (see the invariant on hil-build in build.yml).
+ if: inputs.build-args != '[]'
runs-on: ${{ inputs.os }}
strategy:
fail-fast: false