forked from fzi-forschungszentrum-informatik/Lanelet2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
179 lines (161 loc) · 4.49 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
variables:
GIT_STRATEGY: none
LANELET2_PACKAGES: lanelet2_core lanelet2_io lanelet2_projection lanelet2_python lanelet2_routing lanelet2_traffic_rules
# Cache build results between building and testing
cache:
paths:
- catkin_ws/
stages:
- build
- test
- deploy
# Prepare workspace and checkout the code. This will be executed before every stage
before_script:
# Environment variablen setzen
- export SHELL="/bin/bash"
# Prepare workspace (in folder catkin_ws)
- sudo apt-get update
- mrt ci prepare $CI_PROJECT_NAME -c $CI_COMMIT_SHA
- cd catkin_ws
# add current branch name to branch management
- mrt ws branches add $CI_COMMIT_REF_NAME
# Tests installing on a plain system
build_vanilla:
image: ros
cache: {}
before_script: []
stage: build
script:
- apt-get update
- apt-get install -y libboost-dev libeigen3-dev libgeographic-dev libpugixml-dev libpython-dev libboost-python-dev python-catkin-tools
- mkdir catkin_ws && cd catkin_ws && mkdir src
- catkin init
- cd src
- git clone https://github.com/KIT-MRT/mrt_cmake_modules.git
- git clone $CI_REPOSITORY_URL -b $CI_COMMIT_REF_NAME
- cd ..
- catkin build
build_mrt:
stage: build
script:
# Build project and resolve deps at the same time in debug mode
- mrt catkin build -s -rd --debug --default_yes --no-status $CI_PROJECT_NAME
# generate documentation
- mrt doc clean && mrt doc build
- cp -r build_debug/workspace_doc_* ../doxygen
# make doxygen documentation available in gitlab
artifacts:
name: doxygen
paths:
- doxygen
expire_in: 6 mos
general_code_quality:
stage: build
image: docker:stable
before_script: []
cache: {}
variables:
DOCKER_DRIVER: overlay2
GIT_STRATEGY: fetch
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
- chmod a+rw gl-code-quality-report.json
artifacts:
paths: [gl-code-quality-report.json]
.test: &test_job
stage: test
coverage: '/lines......: \d+.\d+\%/'
cache:
paths:
- catkin_ws/
policy: pull
script:
# Build code again, in case caching didn't work
- mrt catkin build -s -rd --debug --default_yes --no-status $PACKAGE
# Run tests
- source devel_debug/setup.bash
- mrt catkin run_tests --no-status $PACKAGE --no-deps
# Summarize results
- catkin_test_results --verbose build_debug/$PACKAGE
- mkdir ../coverage
- cp -r build_debug/$PACKAGE/coverage ../coverage/$PACKAGE || true
# make coverage information available in gitlab
artifacts:
name: coverage
paths:
- coverage
expire_in: 6 mos
reports:
junit: catkin_ws/build_debug/$PACKAGE/test_results/$PACKAGE/*.xml
test_lanelet2_core:
<<: *test_job
variables:
PACKAGE: lanelet2_core
test_lanelet2_io:
<<: *test_job
variables:
PACKAGE: lanelet2_io
test_lanelet2_projection:
<<: *test_job
variables:
PACKAGE: lanelet2_projection
test_lanelet2_python:
<<: *test_job
variables:
PACKAGE: lanelet2_python
test_lanelet2_routing:
<<: *test_job
variables:
PACKAGE: lanelet2_routing
test_lanelet2_traffic_rules:
<<: *test_job
variables:
PACKAGE: lanelet2_traffic_rules
test_lanelet2_validation:
<<: *test_job
variables:
PACKAGE: lanelet2_validation
test_lanelet2_examples:
<<: *test_job
variables:
PACKAGE: lanelet2_examples
code_quality:
allow_failure: true
cache:
paths:
- catkin_ws/
policy: pull
artifacts:
paths: [gl-code-quality-report.json]
script:
- cat ../gl-code-quality-report.json || true
# Build code again, in case caching didn't work
- mrt catkin build -s -rd --debug --default_yes --no-status $CI_PROJECT_NAME
- source devel_debug/setup.bash
- cd src/lanelet2
- rm codeclimate.json || true
- cp ../../../gl-code-quality-report.json codeclimate.json || true
- mrt ci run_clang_tidy -e $LANELET2_PACKAGES
- cp codeclimate.json ../../../gl-code-quality-report.json
pages:
before_script: []
stage: deploy
script:
# everything in the public folder will be available as website
- mkdir public
- cp -r coverage public/ || true
- cp -r doxygen public/
artifacts:
paths:
- public
only:
# only execute for master branch
- master