Target tests #462
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_log_check_tests: | |
type: boolean | |
required: false | |
default: true | |
run_fota_tests: | |
type: boolean | |
required: false | |
default: true | |
run_fullmfwfota_test: | |
type: boolean | |
required: false | |
default: false | |
run_dfu_tests: | |
type: boolean | |
required: false | |
default: true | |
run_connectivity_bridge_tests: | |
type: boolean | |
required: false | |
default: true | |
run_wifi_location_tests: | |
type: boolean | |
required: false | |
default: true | |
run_modem_trace_tests: | |
type: boolean | |
required: false | |
default: true | |
run_ppk_tests: | |
type: boolean | |
required: false | |
default: false | |
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_log_check_tests: | |
type: boolean | |
required: true | |
default: 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 | |
run_wifi_location_tests: | |
type: boolean | |
required: true | |
default: false | |
run_modem_trace_tests: | |
type: boolean | |
required: true | |
default: false | |
run_ppk_tests: | |
type: boolean | |
required: true | |
default: false | |
jobs: | |
target_test: | |
name: Target Test | |
runs-on: self-hosted | |
permissions: | |
contents: write | |
environment: production | |
container: | |
image: ghcr.io/hello-nrfcloud/firmware:docker-v1.0.3 | |
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 artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: firmware-* | |
merge-multiple: true | |
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-nrf91.elf | |
- name: Run UART tests | |
if: ${{ inputs.run_log_check_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 }} | |
LOG_FILENAME: oob_uart_test_log | |
- 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 }} | |
LOG_FILENAME: oob_fota_test_log | |
- 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 }} | |
LOG_FILENAME: oob_fullmfw_fota_test_log | |
- name: Run DFU tests | |
if: ${{ inputs.run_dfu_tests }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
pytest -s -v -m "dut2 and dfu" \ | |
--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_NET_HEX_FILE: artifacts/connectivity-bridge-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-net.hex | |
NRF53_APP_HEX_FILE: artifacts/connectivity-bridge-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-app.hex | |
NRF53_APP_UPDATE_ZIP: artifacts/connectivity-bridge-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-dfu.zip | |
NRF53_BL_UPDATE_ZIP: artifacts/connectivity-bridge-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-bootloader.zip | |
NRF91_HEX_FILE: artifacts/nrf91-bl-v2.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 | |
LOG_FILENAME: oob_dfu_test_log | |
- name: Run Connectivity Bridge Test | |
if: ${{ inputs.run_connectivity_bridge_tests }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
pytest -s -v -m "dut2 and conn_bridge" \ | |
--junit-xml=results/test-results-connectivity-bridge.xml \ | |
tests | |
env: | |
SEGGER_NRF53: ${{ secrets.SEGGER_DUT_2_EXT_DBG }} | |
UART_ID: ${{ secrets.UART_DUT_2 }} | |
NRF53_NET_HEX_FILE: artifacts/connectivity-bridge-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-net.hex | |
NRF53_APP_HEX_FILE: artifacts/connectivity-bridge-${{ inputs.artifact_fw_version }}-thingy91x-nrf53-app.hex | |
NRF91_CUSTOM_APP_ZIP: artifacts/usb_uart_bridge_app.zip | |
LOG_FILENAME: oob_conn_bridge_test_log | |
- name: Run Wi-Fi location tests | |
if: ${{ inputs.run_wifi_location_tests }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
mkdir -p results | |
pytest -s -v -m "dut1 and wifi" \ | |
--junit-xml=results/test-results-wifi-location.xml \ | |
tests | |
env: | |
SEGGER: ${{ secrets.SEGGER_DUT_1 }} | |
- name: Run modem trace test | |
if: ${{ inputs.run_modem_trace_tests }} | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
mkdir -p results | |
pytest -s -v -m "dut1 and traces" \ | |
--junit-xml=results/test-results-traces-location.xml \ | |
tests | |
env: | |
SEGGER: ${{ secrets.SEGGER_DUT_1 }} | |
- name: Run PPK tests | |
if: ${{ inputs.run_ppk_tests }} | |
id: ppk_test | |
working-directory: thingy91x-oob/tests/on_target | |
run: | | |
mkdir -p results | |
pytest -s -v -m dut_ppk \ | |
--junit-xml=results/test-results-ppk.xml \ | |
tests | |
env: | |
SEGGER: ${{ secrets.SEGGER_DUT_PPK }} | |
- name: Commit and Push Badge File to gh-pages Branch | |
if: always() | |
working-directory: thingy91x-oob | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# Define file paths as variables | |
BADGE_FILE=tests/on_target/power_badge.json | |
HTML_FILE=tests/on_target/power_measurements_plot.html | |
CSV_FILE=tests/on_target/power_measurements.csv | |
# Check if the badge file exists at the specified location | |
if [ -f $BADGE_FILE ]; then | |
echo "Badge file found, proceeding to commit." | |
else | |
echo "Badge file not found. Exiting..." | |
exit 1 | |
fi | |
# Check if the html file exists at the specified location | |
if [ -f $HTML_FILE ]; then | |
echo "Html file found, proceeding to commit." | |
else | |
echo "Html file not found. Exiting..." | |
exit 1 | |
fi | |
# Check if the csv file exists at the specified location | |
if [ -f $CSV_FILE ]; then | |
echo "Csv file found, proceeding to commit." | |
else | |
echo "Csv file not found. Exiting..." | |
exit 1 | |
fi | |
# Configure Git to trust the current working directory | |
git config --global --add safe.directory /__w/firmware/firmware | |
# Set Git user name and email for commits in the GitHub Actions environment | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
# Ensure the gh-pages branch exists and switch to it | |
git fetch origin gh-pages || git checkout -b gh-pages | |
git checkout gh-pages | |
# Stage, commit, and push changes to the branch | |
echo ls tests/on_target/ | |
ls tests/on_target/ | |
echo ls docs/ | |
ls docs/ | |
cp $BADGE_FILE docs/power_badge.json | |
cp $HTML_FILE docs/power_measurements_plot.html | |
cp $CSV_FILE docs/power_measurements.csv | |
git add docs/power_badge.json docs/power_measurements_plot.html docs/power_measurements.csv | |
git commit -m "Update power badge, html and csv to docs folder" | |
git push origin gh-pages | |
- 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 | |
- name: Push log files to artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
id: artifact-upload-test-logs | |
with: | |
name: test-logs | |
path: | | |
thingy91x-oob/tests/on_target/outcomes/logs/*.txt |