-
Notifications
You must be signed in to change notification settings - Fork 90
119 lines (97 loc) · 3.83 KB
/
github-ci.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
name: Sub-IoT-Stack CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
schedule:
- cron: '0 21 * * *'
jobs:
run-unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build stack natively
run: |
mkdir build && cd build
platform="NATIVE"
cmake ../stack/ -DPLATFORM=$platform -DCMAKE_TOOLCHAIN_FILE="../stack/cmake/toolchains/gcc.cmake" -DBUILD_UNIT_TESTS=y -DFRAMEWORK_CONSOLE_ENABLED=n -DTEST_AES=y -DTEST_FEC=y -DTEST_ALP=y -DTEST_FIFO=y -DTEST_SCHEDULER=y -DMODULE_D7AP=n -DFRAMEWORK_MODEM_INTERFACE_ENABLED=n -DFRAMEWORK_USE_POWER_TRACKING=n
make -j
- name: Run unit tests
run: |
./build/tests/aes/test_aes &> results_aes.txt
./build/tests/alp/test_alp &> results_alp.txt
./build/tests/fec/test_fec &> results_fec.txt
./build/tests/fifo/test_fifo &> results_fifo.txt
./build/tests/scheduler/test_scheduler &> results_scheduler.txt
- name: Upload the results
uses: actions/upload-artifact@v2
with:
name: results
path: |
results_aes.txt
results_alp.txt
results_fec.txt
results_fifo.txt
results_scheduler.txt
- name: Handle results
run: |
if ! grep -q 'AES all unit tests OK !' "results_aes.txt"; then exit 1; fi
if ! grep -q 'Unit-tests for ALP completed' "results_alp.txt"; then exit 1; fi
if ! grep -q 'Input was decoded successfully' "results_fec.txt"; then exit 1; fi
if ! grep -q 'All FIFO tests passed!' "results_fifo.txt"; then exit 1; fi
if ! grep -q 'All scheduler tests passed!' "results_scheduler.txt"; then exit 1; fi
generate-builds:
name: Generate Builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up compiler
uses: fiam/arm-none-eabi-gcc@v1
with:
release: '8-2018-q4'
- name: Build stack
run: |
mkdir build && cd build
platform="B_L072Z_LRWAN1"
cmake ../stack/ -DAPP_GATEWAY=y -DAPP_MODEM=y -DAPP_SENSOR_PUSH=y -DPLATFORM=$platform -DFRAMEWORK_DEBUG_ASSERT_REBOOT=y -DMODULE_D7AP_FS_DISABLE_PERMISSIONS=y -DAPP_MODEM_FORWARD_ALP_OVER_SERIAL=y
make -j
cd ..
- name: Upload the builds
uses: actions/upload-artifact@v2
with:
name: build
path: build/
run-testsuite:
name: Run Testsuite
runs-on: self-hosted
needs: generate-builds
steps:
- uses: actions/download-artifact@v3
- name: Flash builds to devices
run: |
if $(lsof -i -P -n | grep -q JLinkExe) ; then exit 1; fi
if pgrep -f "python3 run.py" ; then exit 1; fi
cd build/apps/modem
JLinkExe -SelectEmuBySN 770821797 -CommandFile jlink-flash-full.script > flashOutput1.txt
JLinkExe -SelectEmuBySN 772958091 -CommandFile jlink-flash-full.script > flashOutput2.txt
cat flashOutput1.txt
cat flashOutput2.txt
if grep -q 'FAILED\|ERROR' "flashOutput1.txt"; then exit 1; fi
if grep -q 'FAILED\|ERROR' "flashOutput2.txt"; then exit 1; fi
- name: Run testsuite
run: |
if $(lsof -i -P -n | grep -q JLinkExe) ; then exit 1; fi
if pgrep -f "python3 run.py" ; then exit 1; fi
rm -rf Sub-IoT-testsuite
git clone --recurse-submodules https://github.com/Sub-IoT/Sub-IoT-testsuite.git
cd Sub-IoT-testsuite
python3 -m pip install -r requirements.txt -r lib/pyd7a/requirements.txt
python3 run.py --serial-test-device=/dev/ttyUSB0 --serial-dut=/dev/ttyUSB1 -m "not band433 and not known_issue" --junitxml report.xml -v
- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: test-results
path: Sub-IoT-testsuite/report.xml