-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
184 lines (159 loc) · 4.44 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
variables:
GET_SOURCES_ATTEMPTS: "3"
GIT_DEPTH: "0"
default:
before_script:
- export DEBIAN_FRONTEND=noninteractive
- apt-get update -yq && apt-get install -y curl file git lintian lsb-release
- export DISTRO_CODENAME=`lsb_release -cs` && echo Using distro $DISTRO_CODENAME
- echo Using ROS_DISTRO $ROS_DISTRO
- echo "deb http://apt.roboception.de/stable $DISTRO_CODENAME main" > /etc/apt/sources.list.d/roboception-stable.list
- if [ "$TESTING_DEBS" = "true" ]; then echo "deb http://apt.roboception.de/testing $DISTRO_CODENAME main" > /etc/apt/sources.list.d/roboception-testing.list ; fi
- curl -fsSL http://apt.roboception.de/archive.key | apt-key add -
- apt-get update -yq
- if [ "$ROS_DISTRO" = "rolling" ]; then apt-get -y upgrade; fi
- apt-get install -y ros-${ROS_DISTRO}-rc-common-msgs
- rosdep install --from-paths . --ignore-src -r -y --skip-keys="rc_genicam_api"
- export CMAKE_PREFIX_PATH="/opt/ros/$ROS_DISTRO"
#########################
# Templates using anchors
#########################
.amd64_humble_t: &amd64_humble_job
image: ros:humble-ros-base
tags:
- amd64
- docker
.amd64_rolling_t: &amd64_rolling_job
image: ros:rolling-ros-base
tags:
- amd64
- docker
#############
# Templates
#############
.test:
stage: test
variables:
RC_GENICAM_API_PACKAGE: rc-genicam-api
script:
- apt-get install -y $RC_GENICAM_API_PACKAGE
- mkdir build && cd build
- touch AMENT_IGNORE
- cmake ..
- make -j 4
- CTEST_OUTPUT_ON_FAILURE=1 make test
# run test script with latest debs from testing installed
.test_latest:
extends: .test
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
variables:
RC_GENICAM_API_PACKAGE: rc-genicam-api
script:
- apt-get install -y $RC_GENICAM_API_PACKAGE
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX="/opt/ros/$ROS_DISTRO" -DCMAKE_BUILD_TYPE=Release ..
- make -j 4
- make package
- if [ -z "$APT_REPO" ]; then export APT_REPO=testing; fi
- upload_deb.sh $DISTRO_CODENAME-$APT_REPO *.deb
.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 ####
##############
################
# Testing builds
################
# Test against latest (on every commit)
#######################################
test:humble:amd64:
<<: *amd64_humble_job
extends: .test_latest
test:rolling:amd64:
<<: *amd64_rolling_job
extends: .test_latest
allow_failure: true
# Test against stable (is allowed to fail)
##########################################
test_stable:humble:amd64:
<<: *amd64_humble_job
extends: .test_stable
test_stable:rolling:amd64:
<<: *amd64_rolling_job
extends: .test_stable
# Test against packages in ROS repo
###################################
test_ros:humble:amd64:
<<: *amd64_humble_job
extends: .test
allow_failure: true
variables:
RC_GENICAM_API_PACKAGE: ros-humble-rc-genicam-api
test_ros:rolling:amd64:
<<: *amd64_rolling_job
extends: .test
allow_failure: true
variables:
RC_GENICAM_API_PACKAGE: ros-rolling-rc-genicam-api
# Deploy testing (only on master)
#################################
package_testing:humble:amd64:
<<: *amd64_humble_job
extends: .package_testing
package_testing:rolling:amd64:
<<: *amd64_rolling_job
extends: .package_testing
allow_failure: true
################
# Stable builds
################
# Test against stable if it is a release
########################################
test_release:humble:amd64:
<<: *amd64_humble_job
extends: .test_release
test_release:rolling:amd64:
<<: *amd64_rolling_job
extends: .test_release
allow_failure: true
# Deploy stable (only for releases, version tags)
#################################################
package_stable:humble:amd64:
<<: *amd64_humble_job
extends: .package_stable
package_stable:rolling:amd64:
<<: *amd64_rolling_job
extends: .package_stable
allow_failure: true