-
Notifications
You must be signed in to change notification settings - Fork 26
106 lines (94 loc) · 3.52 KB
/
run_tests_cli.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
name: Build and run CLI tests
on:
workflow_call:
inputs:
nrf_revision:
type: string
required: false
default: "main"
target_board:
description: "target board for tests"
type: string
required: true
jobs:
run_dut_ut:
name: "Run DUT tests (${{inputs.target_board}} - ${{ inputs.subset }})"
runs-on: [self-hosted, linux, x64, "${{inputs.target_board}}"]
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2 --privileged
volumes:
- /dev:/dev
- /run/udev:/run/udev
permissions: write-all
defaults:
run:
shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: sidewalk
- name: update NRF
run: |
rm -rf .west nrf;
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd ..
west init -m https://github.com/nrfconnect/sdk-nrf --mr main . &&
cd nrf &&
git fetch origin ${{inputs.nrf_revision}}:branch_to_run &&
git checkout branch_to_run &&
git rev-parse HEAD &&
cd .. &&
west config manifest.group-filter +sidewalk &&
west update -n -o=--depth=1 --path-cache /workdir/ &&
cd sidewalk && git checkout `cat /workdir/sidewalk_hash` && rm -rf /workdir/sidewalk_hash
- name: Replace slash with underscore
id: replace
run: |
TARGET_BOARD=${{ inputs.target_board }}
TARGET_BOARD=${TARGET_BOARD//\//_}
echo "target_board=$TARGET_BOARD" >> $GITHUB_OUTPUT
- name: Install Python dependencies
run: |
python3 -m pip install -r sidewalk/scripts/ci/requirements.txt
- name: Download tests
run: |
git clone ssh://[email protected]:7999/ama-things/pytest-sidewalk.git
cd pytest-sidewalk
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd utils
git clone ssh://[email protected]:7999/ama-things/sidewalk-fuota.git
cd sidewalk-fuota
./setup.sh
- name: Build dut sample
run: |
source zephyr/zephyr-env.sh
cd sidewalk/sample/sid_end_device
west build -b ${{ inputs.target_board }} -DOVERLAY_CONFIG="overlay-dut.conf"
- name: Flash dut sample
run: |
source zephyr/zephyr-env.sh
cd sidewalk/sample/sid_end_device
west flash
- name: Flash mfg_hex
if: ${{ inputs.target_board }} == "nrf54l15dk/nrf54l15/cpuapp"
run: |
nrfjprog --program pytest-sidewalk/test_objects/mfg/BFFFEA01CA/PCA10156/mfg_v8.hex --sectorerase --verify -r
- name: Flash mfg_hex
if: ${{ inputs.target_board }} != "nrf54l15dk/nrf54l15/cpuapp"
run: |
nrfjprog --program pytest-sidewalk/test_objects/mfg/BFFFEA01CA/mfg_v8.hex --sectorerase --verify -r
- name: Run Tests
run: |
source zephyr/zephyr-env.sh
cd pytest-sidewalk
source .venv/bin/activate
pytest tests/test_sid_dut.py --segger=$(yq '.[0].id' /__w/hardware_map.yaml | tr -d \") --sid-device BFFFEA01CA --html=report.html --self-contained-html
- name: clean artifacts
if: always()
run: |
rm -rf pytest-sidewalk
cd nrf; git checkout main; git branch -D branch_to_run;
rm -rf PACKAGE_ARTIFACTS_* twister-out