-
Notifications
You must be signed in to change notification settings - Fork 391
/
.cirrus.yaml
292 lines (256 loc) · 9.96 KB
/
.cirrus.yaml
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
282
283
284
285
286
287
288
289
290
291
292
#
# Notes
#
# Cirrus CI has a concurrency limit of 24 CPU cores for open source projects.
# This means we should not have more than 6 pipelines with more than 4 CPUs
# in each pipeline running parallel
#
# Documentation:
# - https://cirrus-ci.org/examples/
# - https://cirrus-ci.org/guide/writing-tasks/
#
---
#
# Filter to run the CI only on the main and release branches or for pull request to the main, release* and iox-* branches
#
only_if: false && ($CIRRUS_BRANCH == 'main'
|| $CIRRUS_BRANCH == 'release*'
|| ($CIRRUS_PR != '' && ($CIRRUS_BASE_BRANCH == 'main'
|| $CIRRUS_BASE_BRANCH == 'release*'
|| $CIRRUS_BASE_BRANCH == 'iox-*'
)
))
#
# Templates
#
# Constants
iox_task_timeout_template: &IOX_TASK_TIMEOUT
timeout_in: 15m # This needs to be reasonable large in order not to run in a timeout in the docker image re-builds
iox_common_cpu_and_memory_config_for_builds_template: &IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
cpu: 4
memory: 8GB
iox_common_cpu_and_memory_config_for_tests_template: &IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
cpu: 1
memory: 4GB
# Build and Test
iox_posix_pre_cmake_config_script_template: &IOX_POSIX_PRE_CMAKE_CONFIG
echo "#### Deleting build and iox-tests-bin dir"
&& if [[ -d "build" ]]; then rm -rf build; fi
&& if [[ -d "iox-tests-bin" ]]; then rm -rf iox-tests-vin; fi
iox_posix_post_cmake_config_script_template: &IOX_POSIX_POST_CMAKE_CONFIG
echo "#### Running cmake to build with CIRRUS_CPU = " $CIRRUS_CPU
&& cmake --build build --target install -j $CIRRUS_CPU
iox_posix_cmake_config_strict_with_no_additional_user_script_template: &IOX_POSIX_CMAKE_CONFIG_STRICT_WITH_NO_ADDITIONAL_USER
echo "#### Running cmake to configure build"
&& cmake -Bbuild -Hiceoryx_meta -DBUILD_STRICT=ON -DBINDING_C=ON -DINTROSPECTION=ON -DEXAMPLES=ON -DBUILD_TEST=ON -DTEST_ADD_USER=OFF -DCMAKE_INSTALL_PREFIX=build/install
iox_posix_cmake_config_strict_with_additional_user_script_template: &IOX_POSIX_CMAKE_CONFIG_STRICT_WITH_ADDITIONAL_USER
echo "#### Running cmake to configure build"
&& cmake -Bbuild -Hiceoryx_meta -DBUILD_STRICT=ON -DBINDING_C=ON -DINTROSPECTION=ON -DEXAMPLES=ON -DBUILD_TEST=ON -DTEST_ADD_USER=ON -DCMAKE_INSTALL_PREFIX=build/install
iox_posix_cmake_config_no_strict_with_additional_user_script_template: &IOX_POSIX_CMAKE_CONFIG_NO_STRICT_WITH_ADDITIONAL_USER
echo "#### Running cmake to configure build"
&& cmake -Bbuild -Hiceoryx_meta -DBUILD_STRICT=OFF -DBINDING_C=ON -DINTROSPECTION=ON -DEXAMPLES=ON -DBUILD_TEST=ON -DTEST_ADD_USER=ON -DCMAKE_INSTALL_PREFIX=build/install
iox_posix_clean_build_strict_with_no_additional_user_template: &IOX_POSIX_CLEAN_BUILD_STRICT_WITH_NO_ADDITIONAL_USER
- *IOX_POSIX_PRE_CMAKE_CONFIG
- *IOX_POSIX_CMAKE_CONFIG_STRICT_WITH_NO_ADDITIONAL_USER
- *IOX_POSIX_POST_CMAKE_CONFIG
iox_posix_clean_build_strict_with_additional_user_template: &IOX_POSIX_CLEAN_BUILD_STRICT_WITH_ADDITIONAL_USER
- *IOX_POSIX_PRE_CMAKE_CONFIG
- *IOX_POSIX_CMAKE_CONFIG_STRICT_WITH_ADDITIONAL_USER
- *IOX_POSIX_POST_CMAKE_CONFIG
iox_posix_clean_build_no_strict_with_additional_user_template: &IOX_POSIX_CLEAN_BUILD_NO_STRICT_WITH_ADDITIONAL_USER
- *IOX_POSIX_PRE_CMAKE_CONFIG
- *IOX_POSIX_CMAKE_CONFIG_NO_STRICT_WITH_ADDITIONAL_USER
- *IOX_POSIX_POST_CMAKE_CONFIG
iox_prepare_test_binaries_for_cache_template: &IOX_PREPARE_TEST_BINARIES_FOR_CACHE
- mkdir -p iox-tests-bin
- mv build/hoofs/test/hoofs_mocktests iox-tests-bin
- mv build/hoofs/test/hoofs_moduletests iox-tests-bin
- mv build/hoofs/test/hoofs_integrationtests iox-tests-bin
- mv build/posh/test/posh_moduletests iox-tests-bin
- mv build/posh/test/posh_integrationtests iox-tests-bin
- mv build/binding_c/test/binding_c_moduletests iox-tests-bin
iox_run_tests_template: &IOX_RUN_TESTS
- cd iox-tests-bin
- ./hoofs_mocktests
- ./hoofs_moduletests
- ./hoofs_integrationtests
- ./posh_moduletests
- ./posh_integrationtests
- ./binding_c_moduletests
#
# Preflight-Check
#
preflight_check_task:
container:
dockerfile: tools/ci/docker/ubuntu-22.04
cpu: 1
memory: 4GB
<<: *IOX_TASK_TIMEOUT
clang_format_script: tools/scripts/clang_format.sh check
check_test_ids_script: tools/scripts/check_test_ids.sh
check_invalid_characters_script: tools/scripts/check_invalid_characters.sh
check_atomic_usage: tools/scripts/check_atomic_usage.sh
cmake_linter_script: tools/ci/cmake-linter.sh
#
# Ubuntu 22.04 aarch64
#
ubuntu_22_04_aarch64_build_task:
depends_on: preflight_check
arm_container:
dockerfile: tools/ci/docker/ubuntu-22.04
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: true
fingerprint_key: $CIRRUS_OS_ubuntu_22_04_aarch64_test_binaries_cache_${CIRRUS_BUILD_ID}
build_script:
<<: *IOX_POSIX_CLEAN_BUILD_STRICT_WITH_ADDITIONAL_USER
populate_test_binary_folder_script:
<<: *IOX_PREPARE_TEST_BINARIES_FOR_CACHE
ubuntu_22_04_aarch64_test_task:
depends_on: ubuntu_22_04_aarch64_build
arm_container:
dockerfile: tools/ci/docker/ubuntu-22.04
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: false
fingerprint_key: $CIRRUS_OS_ubuntu_22_04_aarch64_test_binaries_cache_${CIRRUS_BUILD_ID}
test_script:
<<: *IOX_RUN_TESTS
#
# Arch Linux x64 gcc 8.3 aka QNX canary build
#
arch_linux_x64_gcc_8_3_aka_qnx_canary_build_task:
depends_on: preflight_check
container:
dockerfile: tools/ci/docker/archlinux-base-devel
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: true
fingerprint_key: $CIRRUS_OS_archlinux_x64_gcc_8_3_aka_qnx_canary_test_binaries_cache_${CIRRUS_BUILD_ID}
env:
# use GCC 8.3 which corresponds to QCC 8.3 on QNX 7.1
CC: gcc-8
CXX: g++-8
build_script:
<<: *IOX_POSIX_CLEAN_BUILD_STRICT_WITH_ADDITIONAL_USER
populate_test_binary_folder_script:
<<: *IOX_PREPARE_TEST_BINARIES_FOR_CACHE
arch_linux_x64_gcc_8_3_aka_qnx_canary_test_task:
depends_on: arch_linux_x64_gcc_8_3_aka_qnx_canary_build
container:
dockerfile: tools/ci/docker/archlinux-base-devel
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: false
fingerprint_key: $CIRRUS_OS_archlinux_x64_gcc_8_3_aka_qnx_canary_test_binaries_cache_${CIRRUS_BUILD_ID}
test_script:
<<: *IOX_RUN_TESTS
#
# Arch Linux x64
#
arch_linux_x64_build_task:
only_if: false # deactivated for now due to limited compute credits
depends_on: preflight_check
container:
dockerfile: tools/ci/docker/archlinux-base-devel
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: true
fingerprint_key: $CIRRUS_OS_archlinux_x64_test_binaries_cache_${CIRRUS_BUILD_ID}
build_script:
<<: *IOX_POSIX_CLEAN_BUILD_STRICT_WITH_ADDITIONAL_USER
populate_test_binary_folder_script:
<<: *IOX_PREPARE_TEST_BINARIES_FOR_CACHE
arch_linux_x64_test_task:
only_if: false # deactivated for now due to limited compute credits
depends_on: arch_linux_x64_build
container:
dockerfile: tools/ci/docker/archlinux-base-devel
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: false
fingerprint_key: $CIRRUS_OS_archlinux_x64_test_binaries_cache_${CIRRUS_BUILD_ID}
test_script:
<<: *IOX_RUN_TESTS
#
# FreeBSD x64
#
freebsd_x64_build_task:
only_if: false # deactivated for now due to limited compute credits
depends_on: preflight_check
freebsd_instance:
image_family: freebsd-14-0
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: true
fingerprint_key: $CIRRUS_OS_freebsd_x64_test_binaries_cache_${CIRRUS_BUILD_ID}
setup_script:
- pkg install -y cmake git ncurses bash wget
- ln -s /usr/local/bin/bash /bin/bash
build_script:
<<: *IOX_POSIX_CLEAN_BUILD_STRICT_WITH_NO_ADDITIONAL_USER
populate_test_binary_folder_script:
<<: *IOX_PREPARE_TEST_BINARIES_FOR_CACHE
freebsd_x64_test_task:
only_if: false # deactivated for now due to limited compute credits
depends_on: freebsd_x64_build
freebsd_instance:
image_family: freebsd-14-0
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: false
fingerprint_key: $CIRRUS_OS_freebsd_x64_test_binaries_cache_${CIRRUS_BUILD_ID}
test_script:
<<: *IOX_RUN_TESTS
#
# macOS aarch64 [Basic]
#
macos_aarch64_build_task:
only_if: false # deactivated for now due to limited compute credits
depends_on: preflight_check
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_BUILDS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: true
fingerprint_key: $CIRRUS_OS_macOS_aarch64_test_binaries_cache_${CIRRUS_BUILD_ID}
setup_script:
- brew install ncurses
build_script:
<<: *IOX_POSIX_CLEAN_BUILD_STRICT_WITH_NO_ADDITIONAL_USER
populate_test_binary_folder_script:
<<: *IOX_PREPARE_TEST_BINARIES_FOR_CACHE
macos_aarch64_test_task:
only_if: false # deactivated for now due to limited compute credits
depends_on: macos_aarch64_build
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
<<: *IOX_COMMON_CPU_AND_MEMORY_CONFIG_FOR_TESTS
<<: *IOX_TASK_TIMEOUT
test_binaries_cache:
folder: iox-tests-bin
reupload_on_changes: false
fingerprint_key: $CIRRUS_OS_macOS_aarch64_test_binaries_cache_${CIRRUS_BUILD_ID}
env:
# No timing tests on macOS
GTEST_FILTER: "-*TimingTest*"
test_script:
<<: *IOX_RUN_TESTS