Target tests #354
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Target tests | |
on: | |
workflow_call: | |
inputs: | |
artifact_fw_version: | |
type: string | |
required: true | |
artifact_run_id: | |
type: string | |
required: true | |
run_fota_tests: | |
type: boolean | |
required: false | |
default: true | |
run_fullmfwfota_test: | |
type: boolean | |
required: true | |
default: false | |
run_dfu_tests: | |
type: boolean | |
required: false | |
default: true | |
run_connectivity_bridge_tests: | |
type: boolean | |
required: false | |
default: true | |
workflow_dispatch: | |
inputs: | |
artifact_fw_version: | |
description: The firmware version found under this run_id | |
type: string | |
required: true | |
artifact_run_id: | |
description: The run ID of the workflow to fetch artifacts from | |
type: string | |
required: true | |
run_fota_tests: | |
type: boolean | |
required: true | |
default: false | |
run_fullmfwfota_test: | |
type: boolean | |
required: true | |
default: false | |
run_dfu_tests: | |
type: boolean | |
required: true | |
default: false | |
run_connectivity_bridge_tests: | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
target_test: | |
name: Target Test | |
runs-on: self-hosted | |
environment: production | |
container: | |
image: ghcr.io/hello-nrfcloud/firmware:v2.0.0-preview42 | |
options: --privileged | |
volumes: | |
- /dev:/dev:rw | |
- /run/udev:/run/udev | |
- /opt/setup-jlink:/opt/setup-jlink | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: thingy91x-oob | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: firmware | |
path: thingy91x-oob/tests/on_target/artifacts | |
run-id: ${{ inputs.artifact_run_id }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Verify artifact path | |
working-directory: thingy91x-oob | |
run: | | |
ls -l tests/on_target/artifacts | |
- name: Install dependencies | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
pip install -r requirements.txt --break-system-packages | |
- name: Upload symbol file to Memfault | |
working-directory: thingy91x-oob/tests/on_target/artifacts | |
run: | | |
memfault \ | |
--org-token ${{ secrets.MEMFAULT_ORGANIZATION_TOKEN }} \ | |
--org ${{ vars.MEMFAULT_ORGANIZATION_SLUG }} \ | |
--project ${{ vars.MEMFAULT_PROJECT_SLUG }} \ | |
upload-mcu-symbols \ | |
--software-type hello.nrfcloud.com-ci \ | |
--software-version ${{ inputs.artifact_fw_version }} \ | |
hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-debug-app.elf | |
- name: Run UART tests | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
mkdir -p results | |
pytest -s -v -m "dut1 and uart" \ | |
--junit-xml=results/test-results-uart.xml \ | |
tests | |
env: | |
SEGGER: ${{ secrets.SEGGER_DUT_1 }} | |
- name: Run FOTA tests (standard) | |
if: ${{ inputs.run_fota_tests }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
pytest -s -v -m "dut1 and fota" \ | |
--junit-xml=results/test-results-fota.xml \ | |
tests | |
env: | |
SEGGER: ${{ secrets.SEGGER_DUT_1 }} | |
IMEI: ${{ secrets.IMEI_DUT_1 }} | |
FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }} | |
- name: Run FOTA tests (FULLMFW) | |
if: ${{ inputs.run_fullmfwfota_test }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
pytest -s -v -m "dut1 and fullmfw_fota" \ | |
--junit-xml=results/test-results-fullmfw-fota.xml \ | |
tests | |
env: | |
SEGGER: ${{ secrets.SEGGER_DUT_1 }} | |
IMEI: ${{ secrets.IMEI_DUT_1 }} | |
FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }} | |
- name: Run DFU tests | |
if: ${{ inputs.run_dfu_tests }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
pytest -s -v -m dut2 --junit-xml=results/test-results-dfu.xml tests | |
env: | |
SEGGER_NRF53: ${{ secrets.SEGGER_DUT_2_EXT_DBG }} | |
SEGGER_NRF91: ${{ secrets.SEGGER_DUT_2_NRF91 }} | |
UART_ID: ${{ secrets.UART_DUT_2 }} | |
NRF53_HEX_FILE: artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-connectivity-bridge.hex | |
NRF53_APP_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-connectivity-bridge-verbose.zip | |
NRF53_BL_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-bootloader.zip | |
NRF91_HEX_FILE: artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-bootloader.hex | |
NRF91_APP_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-nrf91-dfu.zip | |
NRF91_BL_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ inputs.artifact_fw_version }}-thingy91x-nrf91-bootloader.zip | |
- name: Check nRF53 connectivity bridge version | |
if: ${{ inputs.run_connectivity_bridge_tests }} | |
working-directory: thingy91x-oob | |
run: | | |
python3 ./tests/on_target/utils/thingy91x_dfu.py --check-nrf53-version --serial THINGY91X_${{ secrets.UART_DUT_2 }} 2>&1 >/dev/null | grep "S1: 1" | |
- name: Results | |
if: always() | |
uses: pmeier/[email protected] | |
with: | |
path: thingy91x-oob/tests/on_target/results/*.xml | |
summary: true | |
fail-on-empty: true | |
title: OOB FW Test Results | |
## solution 1: GitHub's Native Test Reporting | |
- name: Upload Test Results | |
uses: actions/upload-test-results@v2 | |
with: | |
files: results/test-results-uart.xml | |
# solution 2: Generate an HTML Report and Upload as an Artifact | |
- name: Generate HTML Report | |
run: junit2html results/test-results-uart.xml results/test-report-uart.html | |
- name: Upload Test Report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Test Report | |
path: results/test-report-uart.html | |
# ## solution 3: Third-Party Action for Enhanced Reporting | |
# - name: Publish Test Results | |
# uses: EnricoMi/publish-unit-test-result-action@v2 | |
# if: always() | |
# with: | |
# files: results/test-results-*.xml | |
# check_name: Test Results | |
# comment_title: Test Results Summary |