-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
188 lines (161 loc) · 4.5 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
stages:
- Compliance
- Build
- Analysis
- Deploy
variables:
IMAGE_BASE: ${CI_REGISTRY}/kwinft/ci-images/archlinux/frameworks-master:latest
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'
####################################################################################################
#
# Compliance
#
Message Lint:
extends: .message-lint
stage: Compliance
Clang-Format:
extends: .clang-format
stage: Compliance
image: ${IMAGE_BASE}
####################################################################################################
#
# Build
#
Coverity Scan:
extends: .coverity-scan
stage: Build
image: ${IMAGE_BASE}
variables:
PROJECT_NAME: Wrapland
.common-build:
variables:
CMAKE_ARGS: ''
stage: Build
image: ${IMAGE_BASE}
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- when: on_success
script:
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr $CMAKE_ARGS ../
- make -j$(nproc)
- make install -j$(nproc)
artifacts:
paths:
- build
expire_in: 1 week
Regular:
extends: .common-build
variables:
CMAKE_ARGS: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DCMAKE_CXX_FLAGS=--coverage -DCMAKE_EXE_LINKER_FLAGS=--coverage
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
Sanitized:
extends: .common-build
variables:
CMAKE_ARGS: -DECM_ENABLE_SANITIZERS='address;leak;undefined'
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
####################################################################################################
#
# Analysis
#
Clang-Tidy:
extends: .clang-tidy
stage: Analysis
image: ${IMAGE_BASE}
needs:
- job: Regular
artifacts: true
.common-test: &common-test
stage: Analysis
image: ${IMAGE_BASE}
Regular Tests:
extends: .tests-with-coverage
variables:
GCOVR_ARGS: --gcov-executable '/usr/bin/llvm-cov gcov' -e tests
<<: *common-test
needs:
- job: Regular
artifacts: true
Sanitized Tests:
extends: .tests
<<: *common-test
needs:
- job: Sanitized
artifacts: true
script:
- export ASAN_OPTIONS=detect_odr_violation=0
- !reference [.tests, script]
####################################################################################################
#
# Deploy
#
Add Coverage:
extends: .add-coverage
variables:
COVERAGE_JOB: Regular Tests
stage: Deploy
pages:
extends: .pages-coverage
stage: Deploy
needs:
- job: Regular Tests
artifacts: true
Master Image:
stage: Deploy
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$CI_PROJECT_NAMESPACE == "kwinft" && $CI_COMMIT_BRANCH == "master" && $CI_PIPELINE_SOURCE == "push"'
when: on_success
- when: never
variables:
TARGET_ID: 17539846
script: curl --request POST --form token=${CI_JOB_TOKEN} --form ref=master
--form "variables[TRIGGER_TYPE]=wrapland_rebuild"
${CI_API_V4_URL}/projects/${TARGET_ID}/trigger/pipeline
Stable Image:
stage: Deploy
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$CI_PROJECT_NAMESPACE == "kwinft" && $CI_COMMIT_BRANCH =~ /^Plasma\// && $CI_PIPELINE_SOURCE == "push"'
when: on_success
- when: never
variables:
TARGET_ID: 17539846
script: curl --request POST --form token=${CI_JOB_TOKEN} --form ref=master
--form "variables[TRIGGER_TYPE]=wrapland_rebuild"
--form "variables[PLASMA_VERSION]=${CI_COMMIT_BRANCH}"
${CI_API_V4_URL}/projects/${TARGET_ID}/trigger/pipeline
Tagged Image:
stage: Deploy
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$CI_PROJECT_NAMESPACE == "kwinft" && $CI_COMMIT_TAG =~ /^wrapland@/ && $CI_PIPELINE_SOURCE == "push"'
when: on_success
- when: never
variables:
TARGET_ID: 17539846
script:
# Get Plasma version from commit tag.
- BRANCH_NAME=$(echo "${CI_COMMIT_TAG}" | sed -e 's,wrapland@\(\),\1,g' | sed -e 's,0.\(.\)\([^\.]*\).*,Plasma/\1.\2,g')
- echo $BRANCH_NAME
- curl --request POST --form token=${CI_JOB_TOKEN} --form ref=master
--form "variables[TRIGGER_TYPE]=wrapland_rebuild"
--form "variables[WRAPLAND_TAG]=${CI_COMMIT_TAG}"
--form "variables[PLASMA_VERSION]=${BRANCH_NAME}"
${CI_API_V4_URL}/projects/${TARGET_ID}/trigger/pipeline