-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
68 lines (60 loc) · 1.68 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
image: nikolausdemmel/visnav_image:20.04
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 & unit test
.compile_and_test_template: &compile_and_test_definition
stage: build
script:
- ./build_submodules.sh ${BUILD_TYPE}
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE}
- make -j2
# run tests, and if any fail, run again verbose
- ctest || (ctest -V && false)
# build on 20.04
focal:
<<: *prepare_docker_definition
<<: *compile_and_test_definition
# build on 18.04
#bionic:
# <<: *prepare_docker_definition
# <<: *compile_and_test_definition
# image: nikolausdemmel/visnav_image:18.04
# only: [master]
# build on macos mojave
#mojave:
# <<: *compile_and_test_definition
# tags: [macos, "10.14"]
# only: [master]
# build on macos catalina
#catalina:
# <<: *compile_and_test_definition
# tags: [macos, "10.15"]
# only: [master]
# check if clang-format would make any changes
clang-format:
tags:
- docker
stage: build
variables:
GIT_SUBMODULE_STRATEGY: none
script:
- clang-format --version
- ./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)