|
1 | | -# On-target hardware test: nRF Cloud provisioning and connection verification. |
| 1 | +# On-target hardware tests on self-hosted runners. |
| 2 | +# |
| 3 | +# Triggers: |
| 4 | +# - push to main: runs every enabled test in .github/test/tests.yml |
| 5 | +# - workflow_dispatch: pick branch (GitHub branch dropdown) and test (all or one id) |
| 6 | +# |
| 7 | +# When adding tests, update workflow_dispatch options below and .github/test/tests.yml. |
2 | 8 | # |
3 | 9 | # Prerequisites: |
4 | 10 | # - nRF54L15 DK + nRF9151 Serial Modem wired and configured per applications/91m1/doc |
|
12 | 18 | # |
13 | 19 | # GitHub secrets: |
14 | 20 | # NRF_CLOUD_API_KEY, NRF_CLOUD_CA_CERT, NRF_CLOUD_CA_KEY |
15 | | -# |
16 | | -# Verification flow: |
17 | | -# 1. Clear application firmware and TF-M credential storage. |
18 | | -# 2. Start pyserial capture, build and flash firmware. |
19 | | -# 3. Read device ID from boot log; confirm missing-credentials warning. |
20 | | -# 4. Delete only CI_NRF54L15_DEVICE_ID from nRF Cloud if present; provision and onboard. |
21 | | -# 5. Wait for "Cloud connected" in the serial log. |
22 | 21 |
|
23 | 22 | name: Test |
24 | 23 |
|
@@ -70,12 +69,75 @@ jobs: |
70 | 69 | hardware_test: |
71 | 70 | needs: plan |
72 | 71 | if: ${{ needs.plan.outputs.matrix != '[]' && needs.plan.outputs.matrix != '' }} |
| 72 | + name: ${{ matrix.id }} |
| 73 | + runs-on: self-hosted |
| 74 | + container: |
| 75 | + image: ghcr.io/zephyrproject-rtos/ci:v0.29.2 |
| 76 | + options: --privileged -v /dev:/dev |
73 | 77 | strategy: |
74 | 78 | fail-fast: false |
75 | 79 | max-parallel: 1 |
76 | 80 | matrix: |
77 | 81 | include: ${{ fromJson(needs.plan.outputs.matrix) }} |
78 | | - uses: ./.github/workflows/${{ matrix.type }}-test.yml |
79 | | - with: |
80 | | - test_id: ${{ matrix.id }} |
81 | | - secrets: inherit |
| 82 | + env: |
| 83 | + CMAKE_PREFIX_PATH: /opt/toolchains |
| 84 | + NRF_CLOUD_API_KEY: ${{ secrets.NRF_CLOUD_API_KEY }} |
| 85 | + NRF_CLOUD_CA_CERT: ${{ secrets.NRF_CLOUD_CA_CERT }} |
| 86 | + NRF_CLOUD_CA_KEY: ${{ secrets.NRF_CLOUD_CA_KEY }} |
| 87 | + CI_NRF54L15_SEGGER_SN: ${{ vars.CI_NRF54L15_SEGGER_SN }} |
| 88 | + CI_NRF54L15_SERIAL_PORT: ${{ vars.CI_NRF54L15_SERIAL_PORT }} |
| 89 | + CI_NRF54L15_DEVICE_ID: ${{ vars.CI_NRF54L15_DEVICE_ID }} |
| 90 | + steps: |
| 91 | + - name: Checkout |
| 92 | + uses: actions/checkout@v6 |
| 93 | + with: |
| 94 | + path: serial-modem-host-applications |
| 95 | + |
| 96 | + - name: Load test configuration |
| 97 | + id: config |
| 98 | + working-directory: serial-modem-host-applications |
| 99 | + run: | |
| 100 | + set -eu |
| 101 | + pip install --quiet -r tests/on_target/requirements.txt |
| 102 | + TEST_JSON="$(PYTHONPATH=tests/on_target python3 -m ci.catalog load "${{ matrix.id }}")" |
| 103 | + { |
| 104 | + echo "test_json<<EOF" |
| 105 | + echo "$TEST_JSON" |
| 106 | + echo "EOF" |
| 107 | + } >> "$GITHUB_OUTPUT" |
| 108 | +
|
| 109 | + - name: Initialize West workspace |
| 110 | + uses: ./serial-modem-host-applications/.github/actions/west-init |
| 111 | + |
| 112 | + - name: Install test dependencies |
| 113 | + run: | |
| 114 | + nrfutil install device |
| 115 | +
|
| 116 | + - name: Run hardware test |
| 117 | + working-directory: serial-modem-host-applications |
| 118 | + env: |
| 119 | + REPO_ROOT: ${{ github.workspace }}/serial-modem-host-applications |
| 120 | + TEST_JSON: ${{ steps.config.outputs.test_json }} |
| 121 | + run: | |
| 122 | + PYTHONPATH=tests/on_target python3 -m pytest \ |
| 123 | + ${{ matrix.pytest_dir }} \ |
| 124 | + -c tests/on_target/tests/pytest.ini \ |
| 125 | + --html=build/hardware-pytest-report.html \ |
| 126 | + --self-contained-html \ |
| 127 | + -v |
| 128 | +
|
| 129 | + - name: Upload serial log |
| 130 | + if: failure() |
| 131 | + uses: actions/upload-artifact@v4 |
| 132 | + with: |
| 133 | + name: hardware-serial-log-${{ matrix.id }}-${{ github.run_id }} |
| 134 | + path: serial-modem-host-applications/build/hardware-serial.log |
| 135 | + if-no-files-found: ignore |
| 136 | + |
| 137 | + - name: Upload pytest report |
| 138 | + if: failure() |
| 139 | + uses: actions/upload-artifact@v4 |
| 140 | + with: |
| 141 | + name: hardware-pytest-report-${{ matrix.id }}-${{ github.run_id }} |
| 142 | + path: serial-modem-host-applications/build/hardware-pytest-report.html |
| 143 | + if-no-files-found: ignore |
0 commit comments