generated from cpp-best-practices/cmake_conan_boilerplate_template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
69 lines (59 loc) · 1.41 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
image: ubuntu:22.04
stages:
- test
- docs_deploy
.setup_linux: &setup_linux |
DEBIAN_FRONTEND=noninteractive
# set time-zone
TZ=Canada/Pacific
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# for downloading
apt-get update -qq
apt-get install -y --no-install-recommends curl gnupg ca-certificates
.setup_cpp: &setup_cpp |
curl -o ./setup-cpp -LJ "https://github.com/aminya/setup-cpp/releases/download/v0.41.1/setup-cpp-x64-linux"
chmod +x ./setup-cpp
./setup-cpp --compiler $compiler --cmake true --ninja true --ccache true --vcpkg true --task true --gcovr 7 --doxygen true
source ~/.cpprc
.test: &test |
task coverage
task coverage_release
task install
test_linux_llvm:
stage: test
variables:
compiler: llvm
script:
- *setup_linux
- *setup_cpp
- *test
- |
# Build the docs
task docs
# On the main branch
if [ "$CI_COMMIT_BRANCH" == "main" ]; then
# Prepare the docs
cp -r ./build/html/ ./public
fi
artifacts:
expire_in: 4 weeks
paths:
- package
- public
test_linux_gcc:
stage: test
variables:
compiler: gcc
script:
- *setup_linux
- *setup_cpp
- *test
pages:
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
image: alpine:latest
stage: docs_deploy
script: "echo 'Deploying website to https://$CI_PAGES_URL/'"
artifacts:
paths:
- public