-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path.gitlab-ci.yml
249 lines (230 loc) · 6.92 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
include:
- remote: 'https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates/-/raw/145b1bc7ef1702d2bd71584010d7113c6786a506/templates/fedora.yml'
- component: gitlab.gnome.org/GNOME/citemplates/release-service@master
inputs:
dist-job-name: "build-release-tarball"
tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
stages:
- prepare
- build
- deploy
variables:
FDO_UPSTREAM_REPO: gnome/libsecret
TARBALL_ARTIFACT_PATH: "_build/meson-dist/${CI_PROJECT_NAME}-${CI_COMMIT_TAG}.tar.xz"
CPPCHECK_OPTIONS: "--enable=warning --enable=style --enable=performance --enable=portability --std=c99 --template='{id}:{file}:{line},{severity},{message}'"
.fedora.container.common:
variables:
# When branching a stable release, change 'main' to the
# release branch name to ensure that a new image will
# be created, tailored for the stable branch.
BRANCH_NAME: 'main'
CONTAINER_TAG: '2025-01-15.0'
FEDORA_VERSION: latest
# Derive FDO variables from this automatically.
# DO NOT edit, instead change the variables above
FDO_REPO_SUFFIX: '${BRANCH_NAME}'
FDO_DISTRIBUTION_TAG: '${CONTAINER_TAG}-fedora-${FEDORA_VERSION}'
FDO_DISTRIBUTION_VERSION: '${FEDORA_VERSION}'
#############################################
# Create CI Docker Images #
#############################################
# See also https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates
build.container.fedora@x86_64:
extends:
- '.fdo.container-build@fedora'
- '.fedora.container.common'
stage: prepare
variables:
# no need to pull the whole tree for rebuilding the image
GIT_STRATEGY: none
# Expiry sets fdo.expires on the image
FDO_EXPIRES_AFTER: 8w
FDO_DISTRIBUTION_PACKAGES: >-
clang-analyzer
cppcheck
dbus-x11
diffutils
docbook-style-xsl
gettext
gi-docgen
git
gjs
glib2-devel
gnutls-devel
gobject-introspection-devel
lcov
libasan
libgcrypt-devel
libpamtest-devel
libubsan
libxslt
meson
pam-devel
pam_wrapper
python3-dbus
python3-gobject
redhat-rpm-config
swtpm
swtpm-tools
tpm2-abrmd
tpm2-tss-devel
vala
valgrind-devel
#############################################
# STAGE: BUILD #
#############################################
.build:
extends:
- '.fdo.suffixed-image@fedora'
- '.fedora.container.common'
parallel:
matrix:
- CRYPTO: libgcrypt
- CRYPTO: gnutls
GNUTLS_FORCE_FIPS_MODE: [0, 1]
- CRYPTO: disabled
fedora:Werror:
stage: build
extends:
- .build
script:
- meson _build -Dwerror=true -Dc_args=-Wno-error=deprecated-declarations -Dgtk_doc=false -Dcrypto=$CRYPTO
- meson compile -C _build
- meson test -C _build --print-errorlogs
artifacts:
reports:
junit: "_build/meson-logs/testlog.junit.xml"
name: "libsecret-werror-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/meson-logs"
fedora:asan:
stage: build
extends:
- .build
script:
- export LSAN_OPTIONS=suppressions=$PWD/build/lsan.supp
- meson _build -Db_sanitize=address -Dgtk_doc=false -Dintrospection=false -Dcrypto=$CRYPTO
- meson compile -C _build
- meson test -C _build --print-errorlogs
artifacts:
reports:
junit: "_build/meson-logs/testlog.junit.xml"
name: "libsecret-asan-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/meson-logs"
fedora:ubsan:
stage: build
extends:
- .build
script:
- meson _build -Db_sanitize=undefined -Dgtk_doc=false -Dcrypto=$CRYPTO
- meson compile -C _build
- meson test -C _build --print-errorlogs
artifacts:
reports:
junit: "_build/meson-logs/testlog.junit.xml"
name: "libsecret-ubsan-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/meson-logs"
fedora-static-analyzers/test:
stage: build
extends:
- .build
script:
- meson _build -Dgtk_doc=false -Dcrypto=$CRYPTO
- meson compile -C _build --ninja-args scan-build
- cppcheck --force -q $CPPCHECK_OPTIONS libsecret/ egg/ tool/
artifacts:
when: on_failure
paths:
- _build/meson-logs/testlog.txt
fedora:PAM:
stage: build
extends:
- .build
script:
- meson _build -Dwerror=true -Dc_args=-Wno-error=deprecated-declarations -Dgtk_doc=false -Dpam=true
- meson compile -C _build
- meson test -C _build --print-errorlogs
artifacts:
reports:
junit: "_build/meson-logs/testlog.junit.xml"
name: "libsecret-pam-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/meson-logs"
fedora:coverage:
extends:
- '.fdo.suffixed-image@fedora'
- '.fedora.container.common'
stage: build
script:
- meson _build -Db_coverage=true -Dtpm2=true -Dgtk_doc=false
- meson compile -C _build
- export XDG_CONFIG_HOME=$HOME/.config
- /usr/share/swtpm/swtpm-create-user-config-files --root
- mkdir -p ${XDG_CONFIG_HOME}/mytpm1
- swtpm_setup --tpm2 --tpmstate $XDG_CONFIG_HOME/mytpm1 --createek --allow-signing --decryption --create-ek-cert --create-platform-cert --lock-nvram --overwrite --display
- swtpm socket --tpm2 --tpmstate dir=$XDG_CONFIG_HOME/mytpm1 --flags startup-clear --ctrl type=tcp,port=2322 --server type=tcp,port=2321 --daemon
- 'tpm2-abrmd --logger=stdout --tcti=swtpm: --session --allow-root --flush-all &'
- 'export TCTI=tabrmd:bus_type=session'
- meson test -C _build --print-errorlogs
- ninja coverage-html -C _build
coverage: '/^\s+lines.+:\s+([\d.]+\%)\s+/'
artifacts:
name: "libsecret-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: on_success
paths:
- _build/meson-logs/coveragereport/
# https://github.com/linux-test-project/lcov/issues/58
allow_failure: true
reference:
extends:
- '.fdo.suffixed-image@fedora'
- '.fedora.container.common'
stage: build
variables:
MESON_ARGS: >-
-Dgtk_doc=true
-Dvapi=false
-Dmanpage=false
script:
- meson ${MESON_ARGS} _build
- ninja -C _build
- mv _build/docs/reference/libsecret/libsecret-1 _reference
artifacts:
paths:
- _reference
#############################################
# STAGE: DEPLOY #
#############################################
build-release-tarball:
extends:
- '.fdo.suffixed-image@fedora'
- '.fedora.container.common'
stage: deploy
script:
- meson setup _build
- meson dist -C _build
artifacts:
paths:
- $TARBALL_ARTIFACT_PATH
pages:
stage: deploy
script:
- mkdir public
- mv _build/meson-logs/coveragereport public/coverage
- mv _reference/* public/
artifacts:
when: on_success
paths:
- public
# https://github.com/linux-test-project/lcov/issues/58
allow_failure: true