-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
94 lines (89 loc) · 3.07 KB
/
.gitlab-ci.yml
File metadata and controls
94 lines (89 loc) · 3.07 KB
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
# Use the official gcc image, based on debian.
# It can use version tags as well, like gcc:8.5.
# See https://hub.docker.com/_/gcc/ for more info.
image: gcc:15
variables:
GIT_SUBMODULE_STRATEGY: recursive
build_gcc:
stage: build
before_script:
- apt-get update
- apt-get -y install catch2 cmake g++ libboost-dev libxml2 libxml2-dev zlib1g-dev
- apt-get install -y firefox-esr --no-install-recommends
# Remove parts of the submodule that are not used but would get into CI's
# way when linting.
- rm -rf ./libstriezel/archive ./libstriezel/common/graphics ./libstriezel/common/gui ./libstriezel/tests
script:
# Syntax check of C++ files. The defaults.hpp file is generated by CMake
# during the build and does not exist yet, so we temporarily copy the
# incomplete template file to its place - and remove it after the syntax
# check is done.
- cp ./code/templates/defaults.prototype.hpp ./code/templates/defaults.hpp
- ./ci/cpplint.sh
- unlink ./code/templates/defaults.hpp
# build and run tests
- mkdir ./build
- cd ./build
- cmake ../
- make -j4
- ctest -V
build_clang:
image: debian:13-slim
stage: build
before_script:
- apt-get update
- apt-get -y install catch cmake clang libboost-dev libxml2 libxml2-dev pkg-config zlib1g-dev
- apt-get install -y firefox-esr --no-install-recommends
# Remove parts of the submodule that are not used but would get into CI's
# way when linting.
- rm -rf ./libstriezel/archive ./libstriezel/common/graphics ./libstriezel/common/gui ./libstriezel/tests
- export CC=clang && export CXX=clang++
script:
# Syntax check of C++ files. The defaults.hpp file is generated by CMake
# during the build and does not exist yet, so we temporarily copy the
# incomplete template file to its place - and remove it after the syntax
# check is done.
- cp ./code/templates/defaults.prototype.hpp ./code/templates/defaults.hpp
- ./ci/cpplint.sh
- unlink ./code/templates/defaults.hpp
# build and run tests
- mkdir ./build
- cd ./build
- cmake ../
- make -j4
- ctest -V
coverage:
image: debian:13-slim
stage: build
before_script:
- apt-get update
- apt-get -y install catch cmake g++ lcov libboost-dev libxml2 libxml2-dev pkg-config zlib1g-dev
- apt-get install -y firefox-esr --no-install-recommends
script:
# build and run tests
- mkdir ./build-coverage
- cd ./build-coverage
- cmake ../ -DCODE_COVERAGE=ON
- make -j4
- ctest -V
# collect code coverage data
- lcov -c --directory . --output-file coverage.info
- lcov --remove coverage.info '/usr/*' '*tests/*' '*libstriezel/*' -o main_coverage.info
- genhtml main_coverage.info --output-directory ../public
coverage: /^[\t ]*lines\.*:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 2 days
paths:
- public
pages:
image: debian:13-slim
stage: deploy
needs: ["coverage"]
dependencies:
- coverage
script:
- ls -l
artifacts:
paths:
- public