forked from roboception/rc_genicam_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
328 lines (272 loc) · 7.2 KB
/
.gitlab-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
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
before_script:
- export DISTRO_CODENAME=`lsb_release -cs` && echo Using distro $DISTRO_CODENAME
- echo -e "\e[0Ksection_start:`date +%s`:install_debs\r\e[0KInstall dependencies"
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -yq && apt-get install -y lintian libusb-1.0 libpng-dev
- echo -e "\e[0Ksection_end:`date +%s`:install_debs\r\e[0K"
variables:
GET_SOURCES_ATTEMPTS: "3"
GIT_DEPTH: "0"
GIT_SUBMODULE_STRATEGY: "recursive"
#########################
# Templates using anchors
#########################
.amd64_bionic_t: &amd64_bionic_job
image: registry.roboception.de/tools/docker_images:bionic-buildimage
tags:
- amd64
- docker
.arm64_bionic_t: &arm64_bionic_job
image: registry.roboception.de/tools/docker_images:bionic-buildimage
tags:
- arm64
- docker
.armhf_bionic_t: &armhf_bionic_job
image: registry.roboception.de/tools/docker_images:armhf-bionic-buildimage
tags:
- armhf
- docker
.amd64_focal_t: &amd64_focal_job
image: registry.roboception.de/tools/docker_images:focal-buildimage
tags:
- amd64
- docker
.arm64_focal_t: &arm64_focal_job
image: registry.roboception.de/tools/docker_images:focal-buildimage
tags:
- arm64
- docker
.armhf_focal_t: &armhf_focal_job
image: registry.roboception.de/tools/docker_images:armhf-focal-buildimage
tags:
- armhf
- docker
.amd64_jammy_t: &amd64_jammy_job
image: registry.roboception.de/tools/docker_images:jammy-buildimage
tags:
- amd64
- docker
#############
# Templates
#############
.test:
stage: test
script:
- echo -e "\e[0Ksection_start:`date +%s`:build\r\e[0KBuild"
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX="/usr" -DINSTALL_COMPLETION=ON ..
- make -j 4
- echo -e "\e[0Ksection_end:`date +%s`:build\r\e[0K"
- echo -e "\e[0Ksection_start:`date +%s`:test\r\e[0KTest"
- CTEST_OUTPUT_ON_FAILURE=1 make test
- echo -e "\e[0Ksection_end:`date +%s`:test\r\e[0K"
# run test script with latest debs from testing installed
.test_latest:
extends: .test
except:
- tags
variables:
TESTING_DEBS: "true"
# run test script with released debs from stable installed (allowed to fail)
.test_stable:
extends: .test
allow_failure: true
except:
- /^v[0-9]+\.[0-9]+\.[0-9]+/
# run test script with released debs from stable (only for releases, mustn't fail)
.test_release:
extends: .test
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+/
except:
- branches
# Debian packaging
.package:
stage: deploy
script:
- echo -e "\e[0Ksection_start:`date +%s`:build\r\e[0KBuild"
- mkdir build && cd build
- if [ -n "$ROS_DISTRO" ]; then
cmake -DCATKIN_BUILD_BINARY_PACKAGE="1" -DCMAKE_INSTALL_PREFIX="/opt/ros/$ROS_DISTRO" -DCMAKE_PREFIX_PATH="/opt/ros/$ROS_DISTRO" -DCMAKE_BUILD_TYPE=Release .. ;
else
cmake -DCMAKE_INSTALL_PREFIX="/usr" -DINSTALL_COMPLETION=ON .. ;
fi
- make -j 4
- make package
- echo -e "\e[0Ksection_end:`date +%s`:build\r\e[0K"
- echo -e "\e[0Ksection_start:`date +%s`:upload\r\e[0KUpload debian package"
- if [ -z "$APT_REPO" ]; then export APT_REPO=testing; fi
- upload_deb.sh $DISTRO_CODENAME-$APT_REPO *.deb
- echo -e "\e[0Ksection_end:`date +%s`:upload\r\e[0K"
.package_testing:
extends: .package
only:
- master
except:
- tags
variables:
TESTING_DEBS: "true"
APT_REPO: "testing"
.package_stable:
extends: .package
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+/
except:
- branches
variables:
APT_REPO: "stable"
##############
#### Jobs ####
##############
gen_dox:
<<: *amd64_focal_job
variables:
TESTING_DEBS: "true"
stage: deploy
script:
- apt-get install -y doxygen ncftp
- mkdir build && cd build
- cmake ..
- make doc
- upload_dox.sh doc/html
only:
- master
- tags
tags:
- docs
################
# Testing builds
################
# Test against latest (for testing builds)
##########################################
test:bionic:amd64:
<<: *amd64_bionic_job
extends: .test_latest
test:bionic:armhf:
<<: *armhf_bionic_job
extends: .test_latest
test:bionic:arm64:
<<: *arm64_bionic_job
extends: .test_latest
test:focal:amd64:
<<: *amd64_focal_job
extends: .test_latest
test:focal:armhf:
<<: *armhf_focal_job
extends: .test_latest
test:focal:arm64:
<<: *arm64_focal_job
extends: .test_latest
test:jammy:amd64:
<<: *amd64_jammy_job
extends: .test_latest
# Test against stable (is allowed to fail)
##########################################
test_stable:bionic:amd64:
<<: *amd64_bionic_job
extends: .test_stable
test_stable:bionic:armhf:
<<: *armhf_bionic_job
extends: .test_stable
test_stable:bionic:arm64:
<<: *arm64_bionic_job
extends: .test_stable
test_stable:focal:amd64:
<<: *amd64_focal_job
extends: .test_stable
test_stable:focal:armhf:
<<: *armhf_focal_job
extends: .test_stable
test_stable:focal:arm64:
<<: *arm64_focal_job
extends: .test_stable
test_stable:jammy:amd64:
<<: *amd64_jammy_job
extends: .test_stable
# Deploy testing (only on master)
#################################
package_testing:bionic:amd64:
<<: *amd64_bionic_job
extends: .package_testing
package_testing:bionic:armhf:
<<: *armhf_bionic_job
extends: .package_testing
package_testing:bionic:arm64:
<<: *arm64_bionic_job
extends: .package_testing
package_testing:focal:amd64:
<<: *amd64_focal_job
extends: .package_testing
package_testing:focal:armhf:
<<: *armhf_focal_job
extends: .package_testing
package_testing:focal:arm64:
<<: *arm64_focal_job
extends: .package_testing
package_testing:jammy:amd64:
<<: *amd64_jammy_job
extends: .package_testing
################
# Stable builds
################
# Test against stable if it is a release
########################################
test_release:bionic:amd64:
<<: *amd64_bionic_job
extends: .test_release
test_release:bionic:armhf:
<<: *armhf_bionic_job
extends: .test_release
test_release:bionic:arm64:
<<: *arm64_bionic_job
extends: .test_release
test_release:focal:amd64:
<<: *amd64_focal_job
extends: .test_release
test_release:focal:armhf:
<<: *armhf_focal_job
extends: .test_release
test_release:focal:arm64:
<<: *arm64_focal_job
extends: .test_release
test_release:jammy:amd64:
<<: *amd64_jammy_job
extends: .test_release
# Deploy stable (only for releases, version tags)
#################################################
package_stable:bionic:amd64:
<<: *amd64_bionic_job
extends: .package_stable
package_stable:bionic:armhf:
<<: *armhf_bionic_job
extends: .package_stable
package_stable:bionic:arm64:
<<: *arm64_bionic_job
extends: .package_stable
package_stable:focal:amd64:
<<: *amd64_focal_job
extends: .package_stable
package_stable:focal:armhf:
<<: *armhf_focal_job
extends: .package_stable
package_stable:focal:arm64:
<<: *arm64_focal_job
extends: .package_stable
package_stable:jammy:amd64:
<<: *amd64_jammy_job
extends: .package_stable
########################
# package as ROS package
########################
ros_testing:melodic:amd64:
image: ros:melodic-perception
tags:
- amd64
- docker
extends: .package_testing
ros_stable:melodic:amd64:
image: ros:melodic-perception
tags:
- amd64
- docker
extends: .package_stable