forked from winft/theseus-ship
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
105 lines (88 loc) · 2.19 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
# SPDX-FileCopyrightText: 2023 Roman Gilg <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-or-later
stages:
- Compliance
- Build
variables:
IMAGE_BASE: ${CI_REGISTRY}/kwinft/ci-images/archlinux/kwinft-base
IMAGE_VERSION: master
IMAGE: ${IMAGE_BASE}-${IMAGE_VERSION}:latest
workflow:
rules:
- when: always
include:
- project: kwinft/tooling
ref: master
file:
- '/analysis/gitlab-ci/static.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
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$IMAGE_VERSION != "master"'
when: never
- if: $CI_COMMIT_TAG
when: never
- when: on_success
.common-stable: &common-stable
rules:
- if: '$COVERITY_SCAN_RUN'
when: never
- if: '$IMAGE_VERSION == "stable"'
when: on_success
- if: $CI_COMMIT_TAG
variables:
IMAGE_VERSION: stable
when: on_success
- when: never
####################################################################################################
#
# Compliance
#
Message Lint:
extends: .message-lint
stage: Compliance
Clang-Format:
extends: .clang-format
stage: Compliance
image: $IMAGE
Reuse:
stage: Compliance
image: python
before_script:
pip install reuse
script:
reuse lint
####################################################################################################
#
# Build
#
Coverity Scan:
extends: .coverity-scan
stage: Build
image: $IMAGE
.common-build: &common-build
stage: Build
image: $IMAGE
script:
- mkdir build && cd build
- cmake -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
-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