-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
130 lines (116 loc) · 3.24 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
image: vladyslavusenko/b_image:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
BUILD_TYPE: Release
# 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 secondary build & unit test configurations
.compile_and_test_template: &compile_and_test_definition
stage: build
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make -j4
- ctest
# main build with benchmark and coverage
bionic-release-compile:
<<: *prepare_docker_definition
stage: build
script:
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make -j4
- ctest
- ./test/benchmark_camera > ../benchmark_camera.txt
- cd ../
- mkdir build_coverage
- cd build_coverage
- cmake .. -DCMAKE_BUILD_TYPE=Coverage
- make -j4
- ctest
- lcov --directory . --capture --output-file coverage.info
- lcov --remove coverage.info '*test/*' '/usr/*' '*thirdparty*' '*googletest*' --output-file coverage.info
- lcov --list coverage.info
artifacts:
paths:
- benchmark_camera.txt
bionic-debug-compile:
<<: *prepare_docker_definition
<<: *compile_and_test_definition
variables:
BUILD_TYPE: Debug
bionic-relwithdebinfo-compile:
<<: *prepare_docker_definition
<<: *compile_and_test_definition
variables:
BUILD_TYPE: RelWithDebInfo
bionic-asan-build:
<<: *prepare_docker_definition
<<: *compile_and_test_definition
variables:
CC: clang-10
CXX: clang++-10
BUILD_TYPE: SanitizerRelWithDebInfo
# LeakSanitizer doesn't work in (non-priviliged) container
ASAN_OPTIONS: "detect_leaks=0"
xenial-release-compile:
<<: *prepare_docker_definition
<<: *compile_and_test_definition
image: vladyslavusenko/b_image_xenial:latest
focal-release-compile:
<<: *prepare_docker_definition
<<: *compile_and_test_definition
image: vladyslavusenko/b_image_focal:latest
mojave-relwithdebinfo-compile:
<<: *compile_and_test_definition
tags: [macos, "10.14"]
variables:
BUILD_TYPE: RelWithDebInfo
#mojave-brewedclang-asan-build:
# <<: *compile_and_test_definition
# tags: [macos, "10.14"]
# variables:
# CC: /usr/local/opt/llvm/bin/clang
# CXX: /usr/local/opt/llvm/bin/clang++
# BUILD_TYPE: SanitizerRelWithDebInfo
catalina-brewedclang-asan-build:
<<: *compile_and_test_definition
tags: [macos, "10.15"]
variables:
CC: /usr/local/opt/llvm/bin/clang
CXX: /usr/local/opt/llvm/bin/clang++
BUILD_TYPE: SanitizerRelWithDebInfo
# check if clang-format would make any changes
clang-format:
tags:
- docker
stage: build
variables:
GIT_SUBMODULE_STRATEGY: none
script:
- ./scripts/clang-format-all.sh
# check if any files are now modified and error if yes
- (if git diff --name-only --diff-filter=M | grep '\..pp$'; then echo $'\n Some files are not properly formatted. You can use "./scripts/clang-format-all.sh".\n'; git diff --diff-filter=M; false; fi)
pages:
tags:
- docker
script:
- doxygen
artifacts:
paths:
- public
only:
- master