|
1 | 1 | # On-target hardware tests on self-hosted runners. |
2 | 2 | # |
3 | 3 | # Triggers: |
4 | | -# - push to main: runs every enabled test in .github/test/tests.yml |
5 | | -# - schedule (03:00 UTC nightly): same as push to main |
6 | | -# - workflow_dispatch: pick branch (GitHub branch dropdown) and test (all or one id) |
| 4 | +# - workflow_call: invoked by ci.yml (prebuilt firmware) or manually from other workflows |
| 5 | +# - workflow_dispatch: pick branch and test (all or one id from .github/test/tests.yml) |
7 | 6 | # |
8 | 7 | # When adding tests, update workflow_dispatch options below and .github/test/tests.yml. |
9 | 8 | # |
|
30 | 29 | name: Test |
31 | 30 |
|
32 | 31 | on: |
33 | | - push: |
34 | | - branches: |
35 | | - - main |
36 | | - schedule: |
37 | | - - cron: '0 3 * * *' |
| 32 | + workflow_call: |
| 33 | + inputs: |
| 34 | + test: |
| 35 | + description: Test id to run, or all for every enabled test |
| 36 | + required: false |
| 37 | + type: string |
| 38 | + default: all |
| 39 | + use_prebuilt_firmware: |
| 40 | + description: Flash firmware downloaded from the Build workflow instead of rebuilding |
| 41 | + required: false |
| 42 | + type: boolean |
| 43 | + default: false |
| 44 | + secrets: inherit |
38 | 45 | workflow_dispatch: |
39 | 46 | inputs: |
40 | 47 | test: |
|
46 | 53 | - all |
47 | 54 | - 91m1_ppp-cloud-connect-nrf54l15 |
48 | 55 | - 91m1_ppp-application-fota-nrf54l15 |
| 56 | + use_prebuilt_firmware: |
| 57 | + description: Download firmware artifacts from a prior Build run in this workflow |
| 58 | + required: false |
| 59 | + type: boolean |
| 60 | + default: false |
49 | 61 |
|
50 | 62 | permissions: |
51 | 63 | contents: read |
52 | 64 |
|
53 | 65 | concurrency: |
54 | | - group: hardware-test-${{ github.ref }} |
| 66 | + group: hardware-test-${{ github.ref }}-${{ github.run_id }} |
55 | 67 | cancel-in-progress: false |
56 | 68 |
|
57 | 69 | jobs: |
|
71 | 83 | id: resolve |
72 | 84 | working-directory: serial-modem-host-applications |
73 | 85 | env: |
74 | | - TEST_FILTER: ${{ github.event_name == 'workflow_dispatch' && inputs.test || 'all' }} |
| 86 | + TEST_FILTER: ${{ inputs.test || 'all' }} |
75 | 87 | run: | |
76 | 88 | pip install --quiet -r tests/on_target/requirements.txt |
77 | 89 | PYTHONPATH=tests/on_target python3 -m ci.catalog matrix --filter "$TEST_FILTER" |
|
92 | 104 | env: |
93 | 105 | CMAKE_PREFIX_PATH: /opt/toolchains |
94 | 106 | NRFUTIL_HOME: /usr/local/share/nrfutil |
| 107 | + CI_USE_PREBUILT_FIRMWARE: ${{ inputs.use_prebuilt_firmware && '1' || '0' }} |
95 | 108 | NRF_CLOUD_API_KEY: ${{ secrets.NRF_CLOUD_API_KEY }} |
96 | 109 | NRF_CLOUD_CA_CERT: ${{ secrets.NRF_CLOUD_CA_CERT }} |
97 | 110 | NRF_CLOUD_CA_KEY: ${{ secrets.NRF_CLOUD_CA_KEY }} |
@@ -122,6 +135,13 @@ jobs: |
122 | 135 | echo "EOF" |
123 | 136 | } >> "$GITHUB_OUTPUT" |
124 | 137 |
|
| 138 | + - name: Download prebuilt firmware |
| 139 | + if: inputs.use_prebuilt_firmware |
| 140 | + uses: actions/download-artifact@v4 |
| 141 | + with: |
| 142 | + name: firmware-${{ matrix.app }} |
| 143 | + path: serial-modem-host-applications/applications/${{ matrix.app }}/build |
| 144 | + |
125 | 145 | - name: Initialize West workspace |
126 | 146 | uses: ./serial-modem-host-applications/.github/actions/west-init |
127 | 147 |
|
@@ -172,7 +192,7 @@ jobs: |
172 | 192 | -v |
173 | 193 |
|
174 | 194 | - name: Upload DuT firmware artifacts |
175 | | - if: always() |
| 195 | + if: always() && inputs.use_prebuilt_firmware != true |
176 | 196 | uses: actions/upload-artifact@v4 |
177 | 197 | with: |
178 | 198 | name: dut-firmware-${{ matrix.app }}-${{ matrix.id }}-${{ github.run_id }} |
|
0 commit comments