Skip to content

Commit c8fc133

Browse files
authored
Merge pull request #485 from aidangarske/spdm-split-runners-v2
Split hardware SPDM CI across runners
2 parents e9c9099 + de47fd5 commit c8fc133

1 file changed

Lines changed: 16 additions & 40 deletions

File tree

.github/workflows/hw-spdm-test.yml

Lines changed: 16 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,36 @@ on:
3535

3636
permissions: read-all
3737

38-
# Serialize runs; hardware state is shared.
39-
concurrency:
40-
group: hw-spdm-runner
41-
cancel-in-progress: false
42-
4338
jobs:
4439
hw-spdm:
4540
if: >
4641
github.event_name != 'pull_request_target' ||
4742
contains(fromJSON('["OWNER","MEMBER"]'),
4843
github.event.pull_request.author_association)
49-
runs-on: [self-hosted, Linux, ARM64, wolftpm-spdm]
44+
runs-on: [self-hosted, Linux, ARM64, "${{ matrix.runner_label }}"]
5045
timeout-minutes: 25
5146

47+
# Serialize per-vendor only — nuvoton and nations now run on separate
48+
# physical Pis, so they can execute in parallel. Group prefixed with
49+
# github.workflow to avoid collisions with other workflows' concurrency
50+
# groups (groups are repo-wide).
51+
concurrency:
52+
group: ${{ github.workflow }}-hw-spdm-runner-${{ matrix.vendor }}
53+
cancel-in-progress: false
54+
5255
strategy:
5356
fail-fast: false
5457
matrix:
5558
include:
5659
- vendor: nuvoton
57-
expected_vendor: "NPCT75x"
60+
runner_label: wolftpm-nuvoton
5861
wolftpm_config: "--enable-spdm --enable-nuvoton --enable-debug"
5962
spi_cs: "0"
6063
modes: "nuvoton"
6164
- vendor: nations
62-
expected_vendor: "NS350"
65+
runner_label: wolftpm-nations
6366
wolftpm_config: "--enable-spdm --enable-nations --enable-debug"
64-
spi_cs: "1"
67+
spi_cs: "0"
6568
modes: "nations nations-psk"
6669

6770
steps:
@@ -141,41 +144,14 @@ jobs:
141144
LDFLAGS="-L${{ steps.wolfssl.outputs.prefix }}/lib"
142145
make -j"$(nproc)"
143146
144-
- name: Reset TPM before detect (shared GPIO 4 reset line)
145-
if: steps.health.outcome == 'success'
146-
run: |
147-
# Mirror spdm_test.sh gpio_reset(): both vendors share this reset line.
148-
# Without this, caps sees a chip left in SPDM-locked state or stale TIS
149-
# from a prior run and returns all-zero vendor/device IDs.
150-
gpioset gpiochip0 4=0 2>/dev/null && sleep 0.1 && gpioset gpiochip0 4=1 2>/dev/null || true
151-
sleep 2
152-
153-
- name: Detect ${{ matrix.vendor }} TPM on SPI CS ${{ matrix.spi_cs }}
154-
id: detect
155-
if: steps.health.outcome == 'success'
156-
env:
157-
LD_LIBRARY_PATH: ${{ steps.wolfssl.outputs.prefix }}/lib
158-
run: |
159-
EXPECTED='${{ matrix.expected_vendor }}'
160-
# caps may hang or error if no chip is at this CS; time-bound it.
161-
OUT=$(timeout 15 ./examples/wrap/caps 2>&1 || true)
162-
echo "$OUT"
163-
if echo "$OUT" | grep -q "Vendor ${EXPECTED}"; then
164-
echo "present=true" >> "$GITHUB_OUTPUT"
165-
echo "[detect] ${EXPECTED} TPM found on CS ${{ matrix.spi_cs }}"
166-
else
167-
echo "present=false" >> "$GITHUB_OUTPUT"
168-
fi
169-
170-
- name: Warn if ${{ matrix.vendor }} TPM not present
171-
if: steps.health.outcome == 'success' && steps.detect.outputs.present == 'false'
172-
run: echo "::warning::${{ matrix.expected_vendor }} not detected on SPI CS ${{ matrix.spi_cs }}. Skipping ${{ matrix.vendor }} SPDM tests — wire the chip and re-run, or ignore if this vendor isn't installed on this runner."
173-
174147
- name: Run SPDM hardware tests (${{ matrix.vendor }})
175-
if: steps.health.outcome == 'success' && steps.detect.outputs.present == 'true'
148+
if: steps.health.outcome == 'success'
176149
env:
177150
LD_LIBRARY_PATH: ${{ steps.wolfssl.outputs.prefix }}/lib
178151
run: |
152+
# spdm_test.sh handles vendor-specific reset (gpio_reset for nuvoton,
153+
# no-reset for nations) and SPDM-lock state internally. No pre-detect
154+
# needed: each runner is dedicated to a single known chip.
179155
set -e
180156
for mode in ${{ matrix.modes }}; do
181157
echo "=== spdm_test.sh mode=$mode ==="

0 commit comments

Comments
 (0)