-
Notifications
You must be signed in to change notification settings - Fork 391
281 lines (259 loc) · 9.79 KB
/
build-test.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# This workflow builds & runs test cases in iceoryx
name: Build & Test
# Triggers the workflow on push or pull request events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main, release*, iox-* ]
jobs:
pre-flight-check:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- run: ./tools/scripts/clang_format.sh check
- run: ./tools/scripts/check_test_ids.sh
- run: ./tools/scripts/check_invalid_characters.sh
- run: ./tools/scripts/check_atomic_usage.sh
- run: ./tools/ci/cmake-linter.sh
check-status-of-nightly-action:
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y jq
- name: Check nightly action status
run: |
COLOR_OFF='\033[0m'
COLOR_RED='\033[1;31m'
COLOR_GREEN='\033[1;32m'
COLOR_YELLOW='\033[1;33m'
LAST_RUN_STATUS=$(curl -s "https://api.github.com/repos/eclipse-iceoryx/iceoryx/actions/workflows/nightly.yml/runs" | jq -r '.workflow_runs[0].conclusion')
if [[ "${LAST_RUN_STATUS}" == "success" ]]; then
echo -e "Last nightly run status: ${COLOR_GREEN}${LAST_RUN_STATUS}${COLOR_OFF}"
else
echo -e "Last nightly run status: ${COLOR_RED}${LAST_RUN_STATUS}${COLOR_OFF}"
echo -e "${COLOR_RED}Error! The nightly workflow failed on the last run. Please check and fix the nightly workflow before merging this PR.${COLOR_OFF}"
echo -e "${COLOR_YELLOW}You can trigger the nightly workflow manually from 'https://github.com/eclipse-iceoryx/iceoryx/actions/workflows/nightly.yml'.${COLOR_OFF}"
echo -e "${COLOR_YELLOW}Just look for the 'Run workflow' button. The branch where the workflow shall run can also be selected.${COLOR_OFF}"
exit 1
fi
build-test-ubuntu:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-20.04
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- name: Setup GCC
uses: egor-tensin/[email protected]
with:
# gcc 8.3 is compiler used in QNX 7.1
version: 8
platform: x64
- name: Setup cmake
uses: jwlawson/[email protected]
with:
cmake-version: '3.16.3' # version used in Ubuntu 20.04 LTS
- run: ./tools/ci/build-test-ubuntu.sh
build-test-windows-msvc:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: windows-latest
needs: pre-flight-check
steps:
- uses: actions/checkout@v4
- run: ./tools/ci/build-test-windows.ps1 -toolchain MSVC
shell: powershell
build-test-windows-mingw:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: windows-latest
needs: pre-flight-check
steps:
- uses: actions/checkout@v4
- uses: egor-tensin/setup-mingw@v2
with:
version: 10.3
platform: x64
- run: ./tools/ci/build-test-windows.ps1 -toolchain MinGW
shell: powershell
# uses ubuntu to run freebsd in a virtualbox
build-test-unix-with-freebsd:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
needs: pre-flight-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Unix (FreeBSD) test
id: Test
uses: vmactions/freebsd-vm@v1
with:
release: "14.0"
copyback: false
prepare: pkg install -y cmake git ncurses bash wget bison
run: |
git config --global --add safe.directory /home/runner/work/iceoryx/iceoryx
./tools/ci/build-test-freebsd.sh
run-integration-test:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Setup ROS
uses: ros-tooling/[email protected]
with:
required-ros-distributions: humble
- uses: actions/checkout@v4
- run: ./tools/ci/run-integration-test.sh
build-test-ubuntu-with-address-sanitizer-gcc-latest:
# prevent stuck jobs consuming runners for 1 hour
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- uses: egor-tensin/[email protected]
with:
version: 13
platform: x64
- uses: actions/checkout@v4
- name: Run Address Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh gcc asan
build-test-ubuntu-with-address-sanitizer-clang-latest:
# prevent stuck jobs consuming runners for 1 hour
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- name: Run Address Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang asan
build-test-macos-with-address-sanitizer:
# prevent stuck jobs consuming runners for 1 hour
timeout-minutes: 60
runs-on: macos-latest
needs: pre-flight-check
steps:
- uses: actions/checkout@v4
- name: Run Address Sanitizer
run: ./tools/ci/build-test-macos-with-sanitizers.sh asan
build-test-ubuntu-with-thread-sanitizer-clang-latest:
# prevent stuck jobs consuming runners for 3 hours
timeout-minutes: 180
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- name: Run Thread Sanitizer
run: ./tools/ci/build-test-ubuntu-with-sanitizers.sh clang tsan
build-test-ubuntu-32-bit:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- run: ./tools/ci/build-test-ubuntu.sh 32-bit-x86
# Bazel sanity check
build-test-ubuntu-bazel:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install iceoryx dependencies and clang-tidy
uses: ./.github/actions/install-iceoryx-deps-and-clang
- run: ./tools/ci/build-test-ubuntu-bazel.sh
# Check run systemd
build-and-run-roudi-with-systemd-ubuntu:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- name: Update
run: sudo apt update
- name: Install depends
run: sudo apt install -y gcc g++ cmake libacl1-dev libncurses5-dev pkg-config libsystemd-dev
- name: Checkout
uses: actions/checkout@v4
- name: Cmake cache
run: cmake -Bbuild -Hiceoryx_meta -DBUILD_SHARED_LIBS=ON -DUSE_SYSTEMD=ON
- name: build
run: cmake --build build -j 16
- name: Install
run: sudo cmake --build build --target install
- name: Ldconfig run
run: sudo ldconfig
- name: Create unit file
run: echo -e "[Unit]\nDescription=Test application roudi\n\n[Service]\nType=notify\nRestartSec=10\nRestart=always\nExecStart=/usr/local/bin/iox-roudi\nTimeoutStartSec=10\nWatchdogSec=5\n\n[Install]\nWantedBy=multi-user.target" | sudo tee /usr/lib/systemd/system/test_iox.service > /dev/null
- name: Show unit
run: cat /usr/lib/systemd/system/test_iox.service
- name: Daemon reload
run: sudo systemctl daemon-reload
- name: Check status
run: sudo systemctl status test_iox || true
- name: Start roudi
run: |
sudo systemctl start test_iox || (echo "Failed to start service"; sudo journalctl -u test_iox -n 50; exit 1)
- name: Wait for 30 seconds
run: sleep 30
- name: Check roudi
run: sudo systemctl status test_iox || (echo "Failed to start service"; sudo journalctl -u test_iox -n 50; exit 1)
- name: Stop roudi
run: sudo systemctl stop test_iox
- name: Show journal
run: sudo journalctl -u test_iox -n 100
coverage-and-docs:
# prevent stuck jobs consuming runners for 6 hours
timeout-minutes: 60
runs-on: ubuntu-latest
needs: pre-flight-check
steps:
- uses: actions/checkout@v4
- run: ./tools/ci/coverage-and-docs.sh
- name: Archive generated doxygen
uses: actions/upload-artifact@v4
with:
name: iceoryx-pdf
path: |
./build/doc/*.pdf
retention-days: 30
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./lcov_results/unittest/lcov/iceoryx_lcov_result_unit.info
name: iceoryx
flags: unittests
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: ./lcov_results/unittest_timing/lcov/iceoryx_lcov_result_unit-timing.info
name: iceoryx
flags: unittests_timing
fail_ci_if_error: false
token: ${{ secrets.CODECOV_TOKEN }}