-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
221 lines (202 loc) · 4.96 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
---
include:
- project: 'guidog/meta-phosh'
ref: '5e3667e2e4d3f23a5dcadaa2a4aadc8824a9e565'
file: '/ci/phosh-common-jobs.yml'
- remote: 'https://gitlab.freedesktop.org/freedesktop/ci-templates/-/raw/6a40df92957c8ce9ee741aaccc5daaaf70545b1e/templates/ci-fairy.yml'
stages:
- build
- test+docs
- style-checks
- deploy
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'
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
variables:
# For ci-fairy
FDO_UPSTREAM_REPO: guidog/phosh-osk-stub
DEBIAN_IMAGE: $CI_REGISTRY/guidog/phosh-osk-stub/debian:v0.0.2024-10-21
XVFB_RUN: xvfb-run -a -s -noreset
COMMON_BUILD_OPTS: --werror -Db_coverage=true
ALPINE_EDGE_DEPS: alpine-sdk feedbackd-dev git glib-dev gnome-desktop-dev
gtk+3.0-dev libhandy1-dev meson musl-dev ninja json-glib-dev
elogind-dev wayland-dev wayland-protocols ttf-dejavu presage-dev
gmobile-dev
.trixie_vars: &trixie_vars
variables:
DIST: trixie
BUILD_OPTS: ${COMMON_BUILD_OPTS}
.trixie_prep: &trixie_prep
before_script:
- apt-get -y update
- apt-get -y build-dep .
.build_step: &build_step
script:
- 'echo "Build opts: ${BUILD_OPTS}"'
- meson ${BUILD_OPTS} . _build
- meson compile -C _build
.test_step: &test_step
script:
- ${XVFB_RUN} meson test --print-errorlogs -C _build
- ninja -C _build coverage-html
check-consistency:
stage: test+docs
extends: .phosh-check-consistency
check-po:
stage: test+docs
extends: .phosh-check-po
check-markdown:
stage: style-checks
variables:
PHOSH_MARKDOWN_PATHS: "*.md"
extends:
- .phosh-check-markdown
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
paths:
- "*.md"
# Sanity checks of MR settings and commit logs
sanity:
extends:
- .fdo.ci-fairy
stage: style-checks
variables:
GIT_DEPTH: "100"
needs: []
script: |
ci-fairy check-commits --signed-off-by --junit-xml=commit-message-junit-report.xml
artifacts:
reports:
junit: commit-message-junit-report.xml
rules:
- if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME'
build:native-debian-trixie:
stage: build
image: ${DEBIAN_IMAGE}
<<: *trixie_prep
<<: *trixie_vars
<<: *build_step
artifacts:
paths:
- _build
except:
variables:
- $PKG_ONLY == "1"
test:native-debian-trixie:
stage: test+docs
image: ${DEBIAN_IMAGE}
<<: *trixie_prep
needs:
- build:native-debian-trixie
<<: *trixie_vars
<<: *test_step
coverage: '/^lines:\s+([\d.]+\%)\s+/'
artifacts:
when: always
reports:
junit: _build/meson-logs/testlog.junit.xml
except:
variables:
- $PKG_ONLY == "1"
doc:
stage: test+docs
image: ${DEBIAN_IMAGE}
<<: *trixie_prep
needs: []
variables:
BUILD_OPTS: >-
-Dgtk_doc=true
script:
- meson ${BUILD_OPTS} _build
- meson compile -C _build
- mv _build/doc/pos-0 _doc/
artifacts:
paths:
- _doc/
except:
variables:
- $PKG_ONLY == "1"
test-layouts:
image: ${DEBIAN_IMAGE}
stage: test+docs
variables:
PKGS: phoc swaybg grim imagemagick phosh-wallpapers dbus-x11
needs:
- build:native-debian-trixie
before_script:
apt-get -y update &&
apt-get -y install $PKGS
script:
- XDG_RUNTIME_DIR=$PWD
WLR_RENDERER=pixman
NO_AT_BRIDGE=1
dbus-launch tools/screenshot-all-layouts.py
artifacts:
expose_as: 'Layouts'
paths:
- _build/screenshots/
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
paths:
# Only run when layouts change…
- src/layouts/*.json
# …or the code handling them…
- src/pos-osk-widget.c
- src/pos-osk-key.c
# …or the stylesheets…
- src/stylesheet/
# …or we're building a release…
- NEWS
build:native-alpinelinux-edge:
stage: build
image: alpine:edge
allow_failure: true
before_script:
- echo "https://alpine.global.ssl.fastly.net/alpine/edge/testing" >> /etc/apk/repositories
- apk add $ALPINE_EDGE_DEPS
artifacts:
paths:
- _build
script:
- git submodule update --recursive
- meson --werror . _build
- meson compile -C _build
except:
variables:
- $PKG_ONLY == "1"
format-check:
stage: style-checks
needs: []
extends: .phosh-format-check
allow_failure: true
pages:
stage: deploy
before_script: []
needs: ['doc']
script:
- mv _doc/ public/
artifacts:
paths:
- public
only:
- main