-
Notifications
You must be signed in to change notification settings - Fork 8
111 lines (98 loc) · 3.78 KB
/
on_target.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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"