-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
49 lines (41 loc) · 1.3 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
# CI configuration for cpp-starter-project
image: registry.gitlab.com/bugwelle/docker-modern-cpp-cmake:master
stages:
- check
- build
- test
clang_format:
stage: check
script:
- ./tools/run_clang_format.sh
- git diff --diff-filter=M --color | cat
- git diff --diff-filter=M --quiet || (echo "Found unformatted files! Use clang-format!"; exit 1)
cmake_format:
stage: check
script:
- ./tools/run_cmake_format.sh
- git diff --diff-filter=M --color | cat
- git diff --diff-filter=M --quiet || (echo "Found unformatted CMakeLists.txt! Use cmake-format!"; exit 1)
cppcheck:
stage: check
script:
- ./tools/run_cppcheck.sh
clang_tidy:
stage: build
script:
- ./tools/build_run_clang_tidy.sh
- git diff --diff-filter=M --color | cat
- git diff --diff-filter=M --quiet || (echo "Found fixable errors! Use clang-tidy!"; exit 1)
build_project_release:
stage: build
script:
- echo "GCC $(which g++)"
- cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=$(which g++)
- cmake --build build -j 2 --target cpp_test
run_unit_tests:
stage: test
script:
- echo "GCC $(which g++)"
- cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=$(which g++)
- cmake --build build -j 2 --target cpp_test
- cd build && make test