|
35 | 35 |
|
36 | 36 | permissions: read-all |
37 | 37 |
|
38 | | -# Serialize runs; hardware state is shared. |
39 | | -concurrency: |
40 | | - group: hw-spdm-runner |
41 | | - cancel-in-progress: false |
42 | | - |
43 | 38 | jobs: |
44 | 39 | hw-spdm: |
45 | 40 | if: > |
46 | 41 | github.event_name != 'pull_request_target' || |
47 | 42 | contains(fromJSON('["OWNER","MEMBER"]'), |
48 | 43 | 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 }}"] |
50 | 45 | timeout-minutes: 25 |
51 | 46 |
|
| 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 | + |
52 | 55 | strategy: |
53 | 56 | fail-fast: false |
54 | 57 | matrix: |
55 | 58 | include: |
56 | 59 | - vendor: nuvoton |
57 | | - expected_vendor: "NPCT75x" |
| 60 | + runner_label: wolftpm-nuvoton |
58 | 61 | wolftpm_config: "--enable-spdm --enable-nuvoton --enable-debug" |
59 | 62 | spi_cs: "0" |
60 | 63 | modes: "nuvoton" |
61 | 64 | - vendor: nations |
62 | | - expected_vendor: "NS350" |
| 65 | + runner_label: wolftpm-nations |
63 | 66 | wolftpm_config: "--enable-spdm --enable-nations --enable-debug" |
64 | | - spi_cs: "1" |
| 67 | + spi_cs: "0" |
65 | 68 | modes: "nations nations-psk" |
66 | 69 |
|
67 | 70 | steps: |
@@ -141,41 +144,14 @@ jobs: |
141 | 144 | LDFLAGS="-L${{ steps.wolfssl.outputs.prefix }}/lib" |
142 | 145 | make -j"$(nproc)" |
143 | 146 |
|
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 | | - |
174 | 147 | - name: Run SPDM hardware tests (${{ matrix.vendor }}) |
175 | | - if: steps.health.outcome == 'success' && steps.detect.outputs.present == 'true' |
| 148 | + if: steps.health.outcome == 'success' |
176 | 149 | env: |
177 | 150 | LD_LIBRARY_PATH: ${{ steps.wolfssl.outputs.prefix }}/lib |
178 | 151 | 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. |
179 | 155 | set -e |
180 | 156 | for mode in ${{ matrix.modes }}; do |
181 | 157 | echo "=== spdm_test.sh mode=$mode ===" |
|
0 commit comments