|
| 1 | +# Reusable nRF Cloud connect hardware test workflow. |
| 2 | +# |
| 3 | +# Provisions credentials on a device with no stored credentials, onboards via |
| 4 | +# onboard.csv, and verifies "Cloud connected" in the serial log. |
| 5 | +# |
| 6 | +# When adding tests, update workflow_dispatch options below and .github/test/tests.yml. |
| 7 | + |
| 8 | +name: Cloud Connect Test |
| 9 | + |
| 10 | +on: |
| 11 | + workflow_call: |
| 12 | + inputs: |
| 13 | + test_id: |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + workflow_dispatch: |
| 17 | + inputs: |
| 18 | + test: |
| 19 | + description: Cloud connect test to run |
| 20 | + required: true |
| 21 | + type: choice |
| 22 | + default: 91m1-cloud-connect-nrf54l15 |
| 23 | + options: |
| 24 | + - 91m1-cloud-connect-nrf54l15 |
| 25 | + |
| 26 | +permissions: |
| 27 | + contents: read |
| 28 | + |
| 29 | +jobs: |
| 30 | + cloud_connect: |
| 31 | + runs-on: self-hosted |
| 32 | + container: |
| 33 | + image: ghcr.io/zephyrproject-rtos/ci:v0.29.2 |
| 34 | + options: --privileged -v /dev:/dev |
| 35 | + env: |
| 36 | + CMAKE_PREFIX_PATH: /opt/toolchains |
| 37 | + NRF_CLOUD_API_KEY: ${{ secrets.NRF_CLOUD_API_KEY }} |
| 38 | + NRF_CLOUD_CA_CERT: ${{ secrets.NRF_CLOUD_CA_CERT }} |
| 39 | + NRF_CLOUD_CA_KEY: ${{ secrets.NRF_CLOUD_CA_KEY }} |
| 40 | + CI_NRF54L15_SEGGER_SN: ${{ vars.CI_NRF54L15_SEGGER_SN }} |
| 41 | + CI_NRF54L15_SERIAL_PORT: ${{ vars.CI_NRF54L15_SERIAL_PORT }} |
| 42 | + CI_NRF54L15_DEVICE_ID: ${{ vars.CI_NRF54L15_DEVICE_ID }} |
| 43 | + steps: |
| 44 | + - name: Checkout |
| 45 | + uses: actions/checkout@v6 |
| 46 | + with: |
| 47 | + path: serial-modem-host-applications |
| 48 | + |
| 49 | + - name: Load test configuration |
| 50 | + id: config |
| 51 | + working-directory: serial-modem-host-applications |
| 52 | + run: | |
| 53 | + set -eu |
| 54 | + pip install --quiet pyyaml |
| 55 | +
|
| 56 | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then |
| 57 | + TEST_ID="${{ github.event.inputs.test }}" |
| 58 | + else |
| 59 | + TEST_ID="${{ inputs.test_id }}" |
| 60 | + fi |
| 61 | +
|
| 62 | + TEST_JSON="$(ROOT=. .github/test/scripts/load-test.sh "$TEST_ID")" |
| 63 | + { |
| 64 | + echo "test_json<<EOF" |
| 65 | + echo "$TEST_JSON" |
| 66 | + echo "EOF" |
| 67 | + } >> "$GITHUB_OUTPUT" |
| 68 | +
|
| 69 | + - name: Initialize West workspace |
| 70 | + uses: ./serial-modem-host-applications/.github/actions/west-init |
| 71 | + |
| 72 | + - name: Install test dependencies |
| 73 | + run: | |
| 74 | + nrfutil install device |
| 75 | +
|
| 76 | + - name: Run cloud connect test |
| 77 | + working-directory: serial-modem-host-applications |
| 78 | + env: |
| 79 | + REPO_ROOT: ${{ github.workspace }}/serial-modem-host-applications |
| 80 | + TEST_JSON: ${{ steps.config.outputs.test_json }} |
| 81 | + run: | |
| 82 | + chmod +x .github/test/cloud/*.sh .github/test/scripts/*.sh |
| 83 | + .github/test/cloud/run.sh |
| 84 | +
|
| 85 | + - name: Upload test summary |
| 86 | + if: always() |
| 87 | + uses: actions/upload-artifact@v4 |
| 88 | + with: |
| 89 | + name: hardware-test-summary-${{ github.run_id }} |
| 90 | + path: serial-modem-host-applications/build/hardware-test-summary.txt |
| 91 | + if-no-files-found: ignore |
| 92 | + |
| 93 | + - name: Upload serial log |
| 94 | + if: failure() |
| 95 | + uses: actions/upload-artifact@v4 |
| 96 | + with: |
| 97 | + name: hardware-serial-log-${{ github.run_id }} |
| 98 | + path: serial-modem-host-applications/build/hardware-serial.log |
| 99 | + if-no-files-found: ignore |
| 100 | + |
| 101 | + - name: Upload pytest report |
| 102 | + if: failure() |
| 103 | + uses: actions/upload-artifact@v4 |
| 104 | + with: |
| 105 | + name: hardware-pytest-report-${{ github.run_id }} |
| 106 | + path: serial-modem-host-applications/build/hardware-pytest-report.html |
| 107 | + if-no-files-found: ignore |
0 commit comments