-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
274 lines (252 loc) · 6.87 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
include:
- project: 'guidog/meta-phosh'
ref: '04a85df2f3311f3012b6c49bf353b376ae0f32b2'
file: '/ci/phosh-common-jobs.yml'
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/d03cddbcff35f26861429fc816c00323f48e99af/templates/ci-fairy.yml'
stages:
- build
- test+docs
- style-checks
- package
- deploy
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
# Don't trigger a branch pipeline if there is an open MR
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
default:
# Protect CI infra from rogue jobs
timeout: 15 minutes
# Allow jobs to be caneled on new commits
interruptible: true
# Retry on infra hickups automatically
retry:
max: 1
when:
- 'api_failure'
- 'runner_system_failure'
- 'scheduler_failure'
- 'stuck_or_timeout_failure'
variables:
# For ci-fairy
FDO_UPSTREAM_REPO: World/Phosh/phoc
ALPINE_EDGE_DEPS: |
git meson ninja gnome-desktop-dev gobject-introspection-dev
libinput-dev wayland-dev wayland-protocols libxkbcommon-dev
xwayland-dev json-glib-dev
ALPINE_EDGE_WLROOTS_DEPS: |
eudev-dev ffmpeg-dev glslang libdisplay-info-dev
libliftoff-dev mesa-dev pixman-dev vulkan-headers vulkan-loader-dev
wayland-dev wayland-protocols xcb-util-image-dev xcb-util-renderutil-dev
xcb-util-wm-dev libseat-dev hwdata-dev
XVFB_RUN: xvfb-run -s -noreset
DEBIAN_IMAGE: $CI_REGISTRY/world/phosh/phoc/debian:v0.0.2024-04-04
.build: &build
script:
- export LC_ALL=C.UTF-8
- meson setup _build $BUILD_ARGS
- meson compile -C _build
- meson install -C _build
.before_script_debian: &before_script_debian
- rm -f ../* || true
# Don't accidentally pull in system headers
- eatmydata apt-get -y remove --purge libwlroots-dev
- dpkg -l
.before_script_alpine: &before_script_alpine
- apk -q add alpine-sdk
- apk -q add $ALPINE_EDGE_DEPS $ALPINE_EDGE_WLROOTS_DEPS
build-with-xwayland-debian-trixie:
stage: build
image: ${DEBIAN_IMAGE}
before_script: *before_script_debian
variables:
BUILD_ARGS: -Dembed-wlroots=enabled -Dxwayland=enabled -Db_coverage=true
<<: *build
artifacts:
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
build-with-xwayland-debian-trixie-clang:
stage: build
image: ${DEBIAN_IMAGE}
variables:
CC: clang
BUILD_ARGS: -Dembed-wlroots=enabled -Dxwayland=enabled -Db_coverage=true --werror
before_script:
- eatmydata apt-get update
- eatmydata apt-get -y remove --purge libwlroots-dev
- eatmydata apt-get -y install clang
<<: *build
artifacts:
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
build-with-xwayland-alpinelinux-edge:
stage: build
image: alpine:edge
before_script: *before_script_alpine
variables:
BUILD_ARGS: -Dembed-wlroots=enabled -Dxwayland=enabled
<<: *build
allow_failure: true
except:
variables:
- $PKG_ONLY == "1"
build-without-xwayland-alpinelinux-edge:
stage: build
image: alpine:edge
before_script: *before_script_alpine
variables:
BUILD_ARGS: -Dembed-wlroots=enabled -Dxwayland=disabled
<<: *build
allow_failure: true
except:
variables:
- $PKG_ONLY == "1"
unit-test-with-xwayland-debian-trixie:
stage: test+docs
image: ${DEBIAN_IMAGE}
needs:
- build-with-xwayland-debian-trixie
before_script: *before_script_debian
script:
- WLR_RENDERER=pixman ${XVFB_RUN} meson test --print-errorlogs -C _build
- ninja -C _build coverage
coverage: '/^lines:\s+([\d.]+\%)\s+/'
artifacts:
when: always
reports:
junit:
- _build/meson-logs/testlog.junit.xml
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
asan-test-native-debian-trixie:
stage: test+docs
image: ${DEBIAN_IMAGE}
tags: [ asan ]
needs: []
before_script: *before_script_debian
script:
- meson setup -Db_sanitize=address _build-asan
- ninja -C _build-asan data/gschemas.compiled
- WLR_RENDERER=pixman ${XVFB_RUN} meson test --verbose -C _build-asan
except:
variables:
- $PKG_ONLY == "1"
allow_failure: true
build-gtkdoc:
stage: test+docs
image: ${DEBIAN_IMAGE}
before_script: *before_script_debian
variables:
BUILD_ARGS: -Dgtk_doc=true -Dembed-wlroots=enabled
script:
- git clean -dfx
- 'echo "Build opts: ${BUILD_ARGS}"'
- meson . _build $BUILD_ARGS
- helpers/doc-check _build
- test -f _build/doc/phoc-*/index.html
- mv _build/doc/phoc-*/ _reference/
artifacts:
paths:
- _reference
except:
variables:
- $PKG_ONLY == "1"
check-po:
stage: test+docs
extends: .phosh-check-po
except:
variables:
- $PKG_ONLY == "1"
format-check:
stage: style-checks
image: ${DEBIAN_IMAGE}
needs: []
before_script: *before_script_debian
script:
- |
if [ -n "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
git remote add target $CI_MERGE_REQUEST_PROJECT_URL.git
echo "Fetching MR target branch $CI_MERGE_REQUEST_TARGET_BRANCH_NAME from $CI_MERGE_REQUEST_PROJECT_URL"
git fetch target "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
git fetch --deepen=100 origin HEAD
merge_base=$(git merge-base "target/$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" HEAD)
if [ -z "$merge_base" ]; then
echo "Could't determine merge base"
exit 1
fi
echo "Merge base: $merge_base"
./.gitlab-ci/check-style.py --dry-run --sha $merge_base
else
echo "Not a merge request"
fi
allow_failure: true
# Sanity checks of MR settings and commit logs
commit-log-check:
extends:
- .fdo.ci-fairy
stage: style-checks
variables:
GIT_DEPTH: "100"
needs: []
script: |
ci-fairy check-commits --junit-xml=commit-message-junit-report.xml
artifacts:
reports:
junit: commit-message-junit-report.xml
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
license-check:
stage: style-checks
image: ${DEBIAN_IMAGE}
needs: []
before_script:
- eatmydata apt-get update
- eatmydata apt-get -y install reuse
script:
reuse lint
artifacts:
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
package-deb-debian-trixie:arm64:
stage: package
variables:
PHOSH_DOCKER_IMAGE: debian:trixie
DEB_BUILD_PROFILES: 'pkg.phoc.embedwlroots'
extends: .phosh-build-debian-package
tags:
- aarch64
package-deb-debian-trixie:sanitizers:arm64:
stage: package
variables:
PHOSH_DOCKER_IMAGE: debian:trixie
DEB_BUILD_PROFILES: 'pkg.phoc.embedwlroots pkg.phoc.sanitizers'
extends: .phosh-build-debian-package
tags:
- aarch64
when: manual
pages:
stage: deploy
needs:
- build-gtkdoc
script:
- mv _reference/ public/
artifacts:
paths:
- public
only:
- main