Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit e230bf3

Browse files
author
Joseph Finnegan
committed
Forgot to add the CI yml
1 parent 0f12f84 commit e230bf3

File tree

1 file changed

+94
-12
lines changed

1 file changed

+94
-12
lines changed

.github/workflows/github-ci.yml

Lines changed: 94 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,105 @@
1-
name: C/C++ CI
1+
name: Sub-IoT-Stack CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ main ]
88

99
jobs:
10-
build:
1110

11+
run-unit-tests:
1212
runs-on: ubuntu-latest
1313

1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: configure
17-
run: ./configure
18-
- name: make
19-
run: make
20-
- name: make check
21-
run: make check
22-
- name: make distcheck
23-
run: make distcheck
16+
17+
- name: Build stack natively
18+
run: |
19+
mkdir build && cd build
20+
platform="NATIVE"
21+
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 -DMODULE_D7AP=n -DMODULE_ALP_SERIAL_INTERFACE_ENABLED=n
22+
make -j
23+
24+
- name: Run unit tests
25+
run: |
26+
./build/tests/aes/test_aes &> results_aes.txt
27+
./build/tests/alp/test_alp &> results_alp.txt
28+
./build/tests/fec/test_fec &> results_fec.txt
29+
./build/tests/fifo/test_fifo &> results_fifo.txt
30+
31+
- name: Upload the results
32+
uses: actions/upload-artifact@v2
33+
with:
34+
name: results
35+
path: |
36+
results_aes
37+
results_alp.txt
38+
results_fec.txt
39+
results_fifo.txt
40+
41+
- name: Handle results
42+
run: |
43+
if ! grep -q 'AES all unit tests OK !' "results_aes.txt"; then exit 1; fi
44+
if ! grep -q 'Unit-tests for ALP completed' "results_alp.txt"; then exit 1; fi
45+
if ! grep -q 'Input was decoded successfully' "results_fec.txt"; then exit 1; fi
46+
if ! grep -q 'All FIFO tests passed!' "results_fifo.txt"; then exit 1; fi
47+
48+
run-testsuite:
49+
50+
runs-on: self-hosted
51+
52+
steps:
53+
- uses: actions/checkout@v3
54+
55+
- name: Set up compiler
56+
uses: fiam/arm-none-eabi-gcc@v1
57+
with:
58+
release: '8-2018-q4'
59+
60+
- name: Build stack
61+
run: |
62+
mkdir build && cd build
63+
platform="B_L072Z_LRWAN1"
64+
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
65+
make -j
66+
cd ..
67+
68+
- name: Upload the builds
69+
uses: actions/upload-artifact@v2
70+
with:
71+
name: build
72+
path: |
73+
build/apps/gateway/
74+
build/apps/modem/
75+
build/apps/sensor_push/
76+
77+
- name: Flash builds to devices
78+
run: |
79+
cd build/apps/modem
80+
JLinkExe -SelectEmuBySN 770821797 -CommandFile jlink-flash-full.script > flashOutput1.txt
81+
JLinkExe -SelectEmuBySN 772958091 -CommandFile jlink-flash-full.script > flashOutput2.txt
82+
cat flashOutput1.txt
83+
cat flashOutput2.txt
84+
if grep -q 'FAILED\|ERROR' "flashOutput1.txt"; then exit 1; fi
85+
if grep -q 'FAILED\|ERROR' "flashOutput2.txt"; then exit 1; fi
86+
87+
- name: Run testsuite
88+
run: |
89+
rm -rf Sub-IoT-testsuite
90+
git clone --recurse-submodules https://github.com/Sub-IoT/Sub-IoT-testsuite.git
91+
cd Sub-IoT-testsuite
92+
pip install -r requirements.txt
93+
cd lib/pyd7a/
94+
pip install -r requirements.txt
95+
cd ../..
96+
python2 run.py --serial-test-device=/dev/ttyUSB0 --serial-dut=/dev/ttyUSB1 -m "not band433 and not band915 and not known_issue" --junitxml report.xml -v
97+
98+
- name: Upload test results
99+
uses: actions/upload-artifact@v2
100+
with:
101+
name: test-results
102+
path: Sub-IoT-testsuite/report.xml
103+
104+
105+

0 commit comments

Comments
 (0)