-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
80 lines (73 loc) · 1.81 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
image: registry.gitlab.vision.in.tum.de/visnav_ss20/team1/event-based-odometry
variables:
GIT_SUBMODULE_STRATEGY: recursive
BUILD_TYPE: RelWithDebInfo
# template for docker builds with ccache
.prepare_docker_template: &prepare_docker_definition
tags:
- docker
before_script:
- mkdir -p ccache
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
- ccache -s
cache:
paths:
- ccache/
key: ${CI_JOB_NAME}
# template for build
.compile_template: &compile_definition
stage: build
script:
- ./build_submodules.sh ${BUILD_TYPE}
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make -j2
artifacts:
paths:
- build/
# build on 18.04
build:
<<: *prepare_docker_definition
<<: *compile_definition
# temlate for unit test
# Disbale for a while
unit-test:
# run tests, and if any fail, run again verbose
stage: test
script:
- cd build
- ctest || (ctest -V && false)
dependencies:
- build
tags:
- atcremers60
- docker
- labpc
- shared
# temlate for memory test
memcheck-test:
stage: test
script:
- cd build
- ctest -V -T memcheck --overwrite MemoryCheckCommandOptions="--leak-check=full --track-origins=yes"
dependencies:
- build
tags:
- atcremers60
- docker
- labpc
- shared
# check if clang-format would make any changes
clang-format:
tags:
- docker
stage: build
variables:
GIT_SUBMODULE_STRATEGY: none
script:
- apt update && apt -qy install clang-format
- ./run_format.sh
# check if any files are now modified and error if yes
- (if [ -n "`git diff --name-only --diff-filter=M --ignore-submodules`" ]; then echo $'\n Some files are not properly formatted. You can use "./run_format.sh".\n'; git diff --diff-filter=M; false; fi)