-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
304 lines (288 loc) · 10 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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
#------------------------------------------------------------
# Copyright (c) 2020 Thomas Kais
#
# This file is subject to the terms and conditions defined in
# file 'COPYING', which is part of this source code package.
#------------------------------------------------------------
variables:
# TLS enabled https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#tls-enabled
DOCKER_TLS_CERTDIR: "/certs"
# Git Shallow cloning https://docs.gitlab.com/ee/ci/large_repositories/#shallow-cloning
#GIT_DEPTH: 10
# Git strategy https://docs.gitlab.com/ee/ci/large_repositories/#git-strategy
GIT_STRATEGY: clone
# https://gitlab.com/help/ci/yaml/README.md#workflowrules-templates
workflow:
rules:
- when: always
RasPiOS32:Buster:
image: docker:git
variables:
DOCKER_BUILDKIT: 1
services:
# Docker in Docker (dind)
- docker:dind
before_script:
- docker info
- echo "$CI_REGISTRY_PASSWORD" | docker login --password-stdin --username $CI_REGISTRY_USER $CI_REGISTRY
# Enable an execution of different multi-architecture containers by QEMU
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
script:
# Using Docker caching https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#using-docker-caching
- docker pull $CI_REGISTRY_IMAGE/buster32:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE/buster32:latest --tag $CI_REGISTRY_IMAGE/buster32:latest --file other/DockerfileBuster32bit .
- docker push $CI_REGISTRY_IMAGE/buster32:latest
- docker run --volume $(pwd):/build/artifact $CI_REGISTRY_IMAGE/buster32:latest
# Buster has reached EOL
allow_failure: true
artifacts:
name: "FotoBox_$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- FotoBox_RasPi32_Buster.tar.gz
RasPiOS64:Buster:
image: docker:git
variables:
DOCKER_BUILDKIT: 1
services:
# Docker in Docker (dind)
- docker:dind
before_script:
- docker info
- echo "$CI_REGISTRY_PASSWORD" | docker login --password-stdin --username $CI_REGISTRY_USER $CI_REGISTRY
# Enable an execution of different multi-architecture containers by QEMU
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
script:
# Using Docker caching https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#using-docker-caching
- docker pull $CI_REGISTRY_IMAGE/buster64:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE/buster64:latest --tag $CI_REGISTRY_IMAGE/buster64:latest --file other/DockerfileBuster64bit .
- docker push $CI_REGISTRY_IMAGE/buster64:latest
- docker run --volume $(pwd):/build/artifact $CI_REGISTRY_IMAGE/buster64:latest
# Buster has reached EOL
allow_failure: true
artifacts:
name: "FotoBox_$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- FotoBox_RasPi64_Buster.tar.gz
RasPiOS32:Bullseye:
image: docker:git
variables:
DOCKER_BUILDKIT: 1
services:
# Docker in Docker (dind)
- docker:dind
before_script:
- docker info
- echo "$CI_REGISTRY_PASSWORD" | docker login --password-stdin --username $CI_REGISTRY_USER $CI_REGISTRY
# Enable an execution of different multi-architecture containers by QEMU
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
script:
# Using Docker caching https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#using-docker-caching
- docker pull $CI_REGISTRY_IMAGE/bullseye32:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE/bullseye32:latest --tag $CI_REGISTRY_IMAGE/bullseye32:latest --file other/DockerfileBullseye32bit .
- docker push $CI_REGISTRY_IMAGE/bullseye32:latest
- docker run --volume $(pwd):/build/artifact $CI_REGISTRY_IMAGE/bullseye32:latest
allow_failure: false
artifacts:
name: "FotoBox_$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- FotoBox_RasPi32_Bullseye.tar.gz
RasPiOS64:Bullseye:
image: docker:git
variables:
DOCKER_BUILDKIT: 1
services:
# Docker in Docker (dind)
- docker:dind
before_script:
- docker info
- echo "$CI_REGISTRY_PASSWORD" | docker login --password-stdin --username $CI_REGISTRY_USER $CI_REGISTRY
# Enable an execution of different multi-architecture containers by QEMU
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
script:
# Using Docker caching https://docs.gitlab.com/ee/ci/docker/using_docker_build.html#using-docker-caching
- docker pull $CI_REGISTRY_IMAGE/bullseye64:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE/bullseye64:latest --tag $CI_REGISTRY_IMAGE/bullseye64:latest --file other/DockerfileBullseye64bit .
- docker push $CI_REGISTRY_IMAGE/bullseye64:latest
- docker run --volume $(pwd):/build/artifact $CI_REGISTRY_IMAGE/bullseye64:latest
allow_failure: false
artifacts:
name: "FotoBox_$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
paths:
- FotoBox_RasPi64_Bullseye.tar.gz
Ubuntu:Bionic:CMake:
image: ubuntu:bionic
before_script:
- apt-get update -qq
- apt-get install -qq
build-essential
ccache
cmake
qt5-default
qttools5-dev
- cmake --version
- gcc --version
- qmake --version
script:
- cmake -G "Unix Makefiles" .
- cmake --build .
after_script:
- tar -cvzf ./FotoBox_Ubuntu_Bionic.tar.gz -C . FotoBox -C ./other/ README.pdf
artifacts:
name: "FotoBox_$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
expose_as: "artifact_UbuntuBionic"
paths:
- FotoBox_Ubuntu_Bionic.tar.gz
Ubuntu:Focal:CMake:
image: ubuntu:focal
variables:
# tzdata prompt for input https://www.reddit.com/r/devops/comments/g781rs/ubuntu_2004_may_be_causing_issues_in_docker/
TZ: "Europe/Berlin"
DEBIAN_FRONTEND: "noninteractive"
before_script:
- apt-get update -qq
- apt-get install -qq
build-essential
ccache
cmake
ninja-build
qt5-default
qttools5-dev
- cmake --version
- gcc --version
- qmake --version
script:
- cmake -G "Ninja" .
- cmake --build .
after_script:
- tar -cvzf ./FotoBox_Ubuntu_Focal.tar.gz -C . FotoBox -C ./other/ README.pdf
artifacts:
name: "FotoBox_$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
expose_as: "artifact_UbuntuFocal"
paths:
- FotoBox_Ubuntu_Focal.tar.gz
Clang:
image: ubuntu:bionic
variables:
CC: "clang-10"
CXX: "clang++-10"
before_script:
- apt-get update -qq
- apt-get install -qq
clang-10
cmake
qt5-default
qttools5-dev
- cmake --version
- clang++-10 --version
script:
# '-Werror' -> Turn warnings into errors
# https://releases.llvm.org/8.0.0/tools/clang/docs/DiagnosticsReference.html
- cmake . -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wpedantic"
- make -j$(nproc) 2>&1 | tee output.txt
- |
if [[ -n $(grep -v "_autogen" output.txt | grep "warning: ") ]] || [[ -n $(grep -v "_autogen" output.txt | grep "error: ") ]]; then
echo -e "\033[1;31m\xE2\x9C\x93 clang diagnostic flags failed!\033[0m";
exit 1;
else
echo -e "\033[1;32m\xE2\x9C\x93 clang diagnostic flags passed!\033[0m";
fi
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
expose_as: "Clang"
when: on_failure
paths:
- output.txt
ClangTidy:
image: ubuntu:bionic
variables:
CC: "clang-10"
CXX: "clang++-10"
CLANG_TIDY: "clang-tidy-10"
before_script:
- apt-get update -qq
- apt-get install -qq
clang-10
llvm-10
clang-tidy-10
cmake
qt5-default
qttools5-dev
- cmake --version
- clang++-10 --version
script:
- cmake . -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-Wno-everything" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_CLANG_TIDY=ON
- make -j$(nproc)
- make -j$(nproc) tidy 2>&1 | tee output.txt
- >
if [[ -n $(grep -v "_autogen" output.txt | grep "warning: ") ]] || [[ -n $(grep -v "_autogen" output.txt | grep "error: ") ]]; then
echo -e "\033[1;31m\xE2\x9C\x93 clang tidy failed!\033[0m";
exit 1;
else
echo -e "\033[1;32m\xE2\x9C\x93 clang tidy passed!\033[0m";
fi
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
expose_as: "ClangTidy"
when: on_failure
paths:
- output.txt
Clazy:
image: ubuntu:focal
variables:
CC: "clang-10"
CXX: "clang++-10"
# tzdata prompt for input https://www.reddit.com/r/devops/comments/g781rs/ubuntu_2004_may_be_causing_issues_in_docker/
TZ: "Europe/Berlin"
DEBIAN_FRONTEND: "noninteractive"
before_script:
- apt-get update -qq
- apt-get install -qq
clazy
clang-10
cmake
qt5-default
qttools5-dev
- clazy --version
- clazy --standalone -version
script:
- cmake . -G "Unix Makefiles" -DCMAKE_CXX_FLAGS="-Wno-everything" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DENABLE_CLANG_CLAZY=ON
- make -j$(nproc)
- make -j$(nproc) clazy 2>&1 | tee output.txt
- >
if [[ -n $(grep -v "_autogen" output.txt | grep "warning: ") ]] || [[ -n $(grep -v "_autogen" output.txt | grep "error: ") ]]; then
echo -e "\033[1;31m\xE2\x9C\x93 clang clazy failed!\033[0m";
exit 1;
else
echo -e "\033[1;32m\xE2\x9C\x93 clang clazy passed!\033[0m";
fi
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
expose_as: "ClangClazy"
when: on_failure
paths:
- output.txt
# https://gitlab.com/pages/doxygen/-/blob/master/.gitlab-ci.yml
Doxygen:
image: alpine
except:
- develop
before_script:
- apk update
- apk add doxygen graphviz ttf-freefont
- doxygen --version
script:
- doxygen other/Doxyfile
pages:
image: alpine
only:
- develop
before_script:
- apk update
- apk add doxygen graphviz ttf-freefont
- doxygen --version
script:
- doxygen other/Doxyfile
- mv html/ public/
artifacts:
paths:
- public