-
Notifications
You must be signed in to change notification settings - Fork 16
157 lines (129 loc) · 5.02 KB
/
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
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
name: build & test
on: [push, pull_request]
jobs:
# This workflow contains 2 jobs build and test
build:
name: Build uoscore-uedhoc
runs-on: ubuntu-latest
steps:
- name: Install Zephyr tools
run: |
wget https://apt.kitware.com/kitware-archive.sh
sudo bash kitware-archive.sh
sudo apt install --no-install-recommends git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 lcov gdb
cmake --version
python3 --version
dtc --version
pip3 install tabulate
sudo apt install python3-venv
python3 -m venv ~/zephyrproject/.venv
source ~/zephyrproject/.venv/bin/activate
pip3 install west
west init ~/zephyrproject
cd ~/zephyrproject
west update
west zephyr-export
pip install -r ~/zephyrproject/zephyr/scripts/requirements.txt
cd ~
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3/zephyr-sdk-0.16.3_linux-x86_64.tar.xz
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.3/sha256.sum | shasum --check --ignore-missing
tar xvf zephyr-sdk-0.16.3_linux-x86_64.tar.xz
cd zephyr-sdk-0.16.3
/bin/bash -c "yes | ./setup.sh"
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
### build, test and archive
# native_posix (0x68)
- name: Build native_posix
run: |
source ~/zephyrproject/zephyr/zephyr-env.sh
source ~/zephyrproject/.venv/bin/activate
cd test/
bash ci_scripts/test_build_options.sh
- name: Archive static lib
uses: actions/upload-artifact@v2
with:
name: uoscore-uedhoc-x86
path: test/build/uoscore_uedhoc/libuoscore-uedhoc.a
# native_posix_64
- name: Build native_posix_64
run: |
source ~/zephyrproject/zephyr/zephyr-env.sh
source ~/zephyrproject/.venv/bin/activate
cd test/
rm -rf build
rm -rf build_lib_test
west build -b=native_posix_64
west build -t run
- name: Archive static lib
uses: actions/upload-artifact@v2
with:
name: uoscore-uedhoc-x86-64
path: test/build/uoscore_uedhoc/libuoscore-uedhoc.a
### Generate ROM report
- name: Genrate ROM report
run: |
source ~/zephyrproject/zephyr/zephyr-env.sh
source ~/zephyrproject/.venv/bin/activate
cd test/
bash ci_scripts/flash_report_gen.sh
- name: Upload rom report with tinycrypt
uses: actions/upload-artifact@v2
with:
name: rom-report-tinycrypt-crypto
path: test/build_reports/rom_report_nrf91_with_tinycrypt.txt
- name: Upload rom report with mbedtls
uses: actions/upload-artifact@v2
with:
name: rom-report-mbedtls-crypto
path: test/build_reports/rom_report_nrf91_with_mbedtls.txt
### Generate stack report
- name: Genrate stack report
run: |
source ~/zephyrproject/zephyr/zephyr-env.sh
source ~/zephyrproject/.venv/bin/activate
cd test/
bash ci_scripts/stack_report_gen.sh
- name: Upload stack report
uses: actions/upload-artifact@v2
with:
name: stack-report
path: test/build_reports/stack_report.html
### Generate test coverage report
- name: Build native_posix with coverage information
run: |
source ~/zephyrproject/zephyr/zephyr-env.sh
source ~/zephyrproject/.venv/bin/activate
cd test/
rm -rf build
rm -rf build_lib_test
west build -b native_posix -- -DCONFIG_COVERAGE=y
west build -t run
lcov --capture --directory ./ --output-file lcov.info -q --rc lcov_branch_coverage=1
genhtml lcov.info --output-directory lcov_html -q --ignore-errors source --branch-coverage --highlight --legend
tar -zcvf github-pages.tar.gz lcov_html
- name: Upload test coverage report
uses: actions/upload-pages-artifact@v1
with:
name: github-pages
path: test/lcov_html
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1