Skip to content

Target tests

Target tests #306

Workflow file for this run

name: Target tests
on:
workflow_call:
workflow_dispatch:
inputs:
build:
required: true
type: boolean
description: Build the firmware before running tests
schedule:
- cron: "0 0 * * *"
push:
branches:
- main
jobs:
build:
if: ${{ github.event.inputs.build == ''}}
uses: ./.github/workflows/build.yml
secrets: inherit
with:
build_bl_update: true
test:
name: Test
# needs: build
runs-on: self-hosted
environment: production
container:
image: ghcr.io/jorgenmk/hello-fw:latest
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
if: ${{ github.event.inputs.build == '' }}
uses: actions/download-artifact@v4
with:
name: firmware
path: thingy91x-oob/tests/on_target/artifacts
- name: Download old artifact
if: ${{ github.event.inputs.build != '' }}
run: |
echo ${{ github.event.inputs.build }}
python3 thingy91x-oob/tests/on_target/utils/download_artifacts.py \
${{ secrets.GITHUB_TOKEN }}
- name: Set version
shell: bash
run: |
if [[ "${{ startsWith(github.ref, 'refs/tags/') }}" == "true" ]]; then
echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV
fi
- 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: Run UART tests
working-directory: thingy91x-oob/tests/on_target
run: |
pytest -s -v -m "dut1 and uart" tests --firmware-hex artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app.hex
env:
SEGGER: ${{ secrets.SEGGER_DUT_1 }}
- name: Run FOTA tests
working-directory: thingy91x-oob/tests/on_target
run: |
pytest -s -v -m "dut1 and fota" tests --firmware-hex artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-debug-app.hex
env:
SEGGER: ${{ secrets.SEGGER_DUT_1 }}
IMEI: ${{ secrets.IMEI_DUT_1 }}
FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }}
- name: Run DFU tests
working-directory: thingy91x-oob/tests/on_target
run: |
pytest -s -v -m dut2 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-${{ env.VERSION }}-thingy91x-nrf53-connectivity-bridge.hex
NRF53_APP_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-connectivity-bridge-verbose.zip
NRF53_BL_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf53-bootloader.zip
NRF91_HEX_FILE: artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-bootloader.hex
NRF91_APP_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf91-dfu.zip
NRF91_BL_UPDATE_ZIP: artifacts/hello.nrfcloud.com-${{ env.VERSION }}-thingy91x-nrf91-bootloader.zip
- name: Check nRF53 connectivity bridge version
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"