-
Notifications
You must be signed in to change notification settings - Fork 10
221 lines (208 loc) · 6.61 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
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_functional_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: Tests
working-directory: thingy91x-oob/tests/on_target
run: |
mkdir -p results
pytest -s -v \
--junit-xml=results/test-results-dut1.xml \
--html=results/test-results-dut1.html --self-contained-html \
tests/test_functional
env:
SEGGER: ${{ secrets.SEGGER_DUT_1 }}
IMEI: ${{ secrets.IMEI_DUT_1 }}
FINGERPRINT: ${{ secrets.FINGERPRINT_DUT_1 }}
LOG_FILENAME: oob_uart_test_log
TEST_FUNCTIONAL: ${{ inputs.run_functional_tests }}
TEST_FOTA: ${{ inputs.run_fota_tests }}
TEST_FOTA_FULLMFW: ${{ inputs.run_fullmfwfota_test }}
TEST_WIFI_LOC: ${{ inputs.run_wifi_location_tests }}
TEST_TRACES: ${{ inputs.run_modem_trace_tests }}
TEST_REPORT_NAME: OOB Firwmare Functional Test Report
DUT1_HW_REVISION: ${{ vars.DUT1_HW_REVISION }}
- 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 \
--html=results/test-results-bridge.html --self-contained-html \
tests/test_bridge
env:
SEGGER_NRF53: ${{ secrets.SEGGER_DUT_2_EXT_DBG }}
SEGGER_NRF91: ${{ secrets.SEGGER_DUT_2_NRF91 }}
UART_ID: ${{ secrets.UART_DUT_2 }}
TEST_REPORT_NAME: OOB Firwmare Bridge Test Report
LOG_FILENAME: oob_dfu_test_log
- name: Run PPK tests
if: ${{ inputs.run_ppk_tests }}
continue-on-error: true
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 \
--html=results/test-results-ppk.html --self-contained-html \
tests/test_ppk
env:
SEGGER: ${{ secrets.SEGGER_DUT_PPK }}
- name: Commit and Push Badge File to gh-pages Branch
if: ${{ inputs.run_ppk_tests }}
continue-on-error: true
working-directory: thingy91x-oob
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./tests/on_target/scripts/commit_badge.sh
- 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: Create Report Artifact
if: always()
uses: actions/upload-artifact@v4
id: artifact-report
with:
name: test-report
path: |
thingy91x-oob/tests/on_target/results/*.html
- 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