-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
129 lines (105 loc) · 2.55 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
stages:
- Compliance
- Build
- Analysis
- Deploy
variables:
IMAGE_BASE: ${CI_REGISTRY}/kwinft/ci-images/archlinux/kwinft-base
workflow:
rules:
- when: always
include:
- project: kwinft/tooling
ref: master
file:
- '/analysis/gitlab-ci/static.yml'
- '/analysis/gitlab-ci/tests.yml'
- '/docs/gitlab-ci/commits.yml'
# We use the following two job templates because we build with different images on master and
# stable branches and GitLab CI does allow to set the image name only through variable expansion.
.common-master: &common-master
image: ${IMAGE_BASE}-master:latest
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$CI_COMMIT_BRANCH =~ /^Plasma\// || $CI_COMMIT_TAG'
when: never
- when: on_success
.common-stable: &common-stable
image: ${IMAGE_BASE}-stable:latest
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$CI_COMMIT_BRANCH =~ /^Plasma\// || $CI_COMMIT_TAG'
when: on_success
- when: never
####################################################################################################
#
# Compliance
#
Message Lint:
extends: .message-lint
stage: Compliance
Clang-Format:
extends: .clang-format
stage: Compliance
image: ${IMAGE_BASE}-master:latest
####################################################################################################
#
# Build
#
.common-build: &common-build
stage: Build
script:
- mkdir build && cd build
- cmake
-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage
-DCMAKE_INSTALL_PREFIX:PATH=/usr ../
- make -j$(nproc)
- make install -j$(nproc)
artifacts:
paths:
- build
expire_in: 1 week
Master Build:
<<: *common-build
<<: *common-master
Stable Build:
<<: *common-build
<<: *common-stable
####################################################################################################
#
# Analysis
#
.common-test:
extends: .tests-with-coverage
stage: Analysis
variables:
GCOVR_ARGS: -e tests
Master Tests:
extends: .common-test
<<: *common-master
needs:
- job: Master Build
artifacts: true
Stable Tests:
extends: .common-test
<<: *common-stable
needs:
- job: Stable Build
artifacts: true
####################################################################################################
#
# Deploy
#
Add Coverage:
extends: .add-coverage
stage: Deploy
variables:
COVERAGE_JOB: Master Tests
pages:
extends: .pages-coverage
stage: Deploy
needs:
- job: Master Tests
artifacts: true