-
Notifications
You must be signed in to change notification settings - Fork 27
117 lines (104 loc) · 3.64 KB
/
run_tests.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
name: Build Sidewalk samples
on:
workflow_call:
inputs:
nrf_revision:
type: string
required: false
default: "main"
boards_to_test:
type: string
required: true
default: '["nrf52840dk/nrf52840", "nrf5340dk/nrf5340/cpuapp", "nrf54l15dk/nrf54l15/cpuapp", "nrf54l15dk/nrf54l15/cpuapp/ns", "nrf54l15dk/nrf54l10/cpuapp"]'
jobs:
build_and_run_x86_tests:
runs-on: ubuntu-24.04
container:
image: ghcr.io/nrfconnect/sdk-sidewalk:main
options: --cpus 2
defaults:
run:
shell: nrfutil toolchain-manager launch --install-dir /root/ncs bash -- {0}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
path: sidewalk
- name: update NRF
run: |
cd sidewalk && git rev-parse HEAD > /workdir/sidewalk_hash && cd .. &&
cp -r /workdir/nrf nrf;
west init -l nrf &&
cd nrf &&
git fetch origin ${{inputs.nrf_revision}}:PR-branch &&
git checkout PR-branch &&
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: Install Python dependencies
run: |
python3 -m pip install -r nrf/scripts/requirements.txt -r zephyr/scripts/requirements.txt -r sidewalk/scripts/ci/requirements.txt
- name: Ccache
id: ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-test_x86-${{ github.run_id }}
restore-keys: ccache-test_x86-
- name: Twister build and run x86 tests
run: |
source zephyr/zephyr-env.sh
west twister --test-config sidewalk/test_config.yaml --level="Github_tests" --testsuite-root sidewalk --platform native_sim --platform native_posix --platform unit_testing --coverage --coverage-basedir sidewalk --coverage-formats html,xml --enable-ubsan --enable-lsan --enable-asan --inline-logs --overflow-as-errors -vvv
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: tests-x86_result
path: |
twister-out/twister.xml
twister-out/**/handler.log
twister-out/**/device.log
twister-out/coverage
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: 'twister-out/coverage/coverage.xml'
badge: true
format: 'markdown'
output: 'both'
- name: publish coverage summary
run: |
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
build-and-test_on_hw:
strategy:
fail-fast: false
matrix:
subset: [1, 2]
board: ${{ fromJson(inputs.boards_to_test) }}
uses: ./.github/workflows/run_tests_dut.yml
with:
subset: ${{ matrix.subset }}
max_subsets: 2
run_tests: true
target_board: ${{ matrix.board }}
nrf_revision: ${{ inputs.nrf_revision }}
merge_tests_on_hw:
needs: build-and-test_on_hw
runs-on: ubuntu-24.04
if: always()
permissions: write-all
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
delete-merged: true
name: tests-dut_result
pattern: tests-dut_result_*
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
delete-merged: true
name: tests-dut_artifacts
pattern: DUT_artifacts_*