blob: ef0a6dc7ebf1c53a2685dc41b431f27cb4dba963 (
plain)
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
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
|
# -*- indent-tabs-mode: nil -*-
include:
- local: 'ci/container_builds.yml'
# Enable merge request pipelines and avoid duplicate pipelines
# https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines
workflow:
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
when: never
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH'
variables:
LIBRSVG_DEBUG: "yes"
# Turn compiler warnings into errors
RUSTFLAGS: '-D warnings'
stages:
- container-build
- check
- build
- lint
- analysis
- acceptance test
- docs
default:
interruptible: true
check:
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache_push'
stage: check
needs: ['opensuse-container@x86_64.stable']
script:
- cargo check --all-targets
cargo_test:
stage: check
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
# Tests require extra crates, hence cache is pushed
- '.cache_push'
needs:
- job: check
artifacts:
when: 'on_failure'
paths:
- _build/tests/output
expire_in: 1 day
variables:
OUT_DIR: "${CI_PROJECT_DIR}/tests/output"
script:
- cargo test -- --skip loading_crash --skip reference --skip render_crash
.build-rsvg-no-docs:
extends: '.cache'
stage: build
script:
- mkdir -p _build
- cd _build
- ../autogen.sh --disable-gtk-doc --enable-vala
- make
- make check
artifacts:
when: 'on_failure'
paths:
- _build/tests/*.log
- _build/tests/output
expire_in: 1 day
.build-rsvg-full:
extends: '.cache'
stage: build
script:
- mkdir -p _build
- cd _build
- ../autogen.sh --enable-gtk-doc --enable-vala
- make
- make check
artifacts:
when: 'always'
paths:
- _build/doc/
- _build/tests/*.log
expire_in: 1 day
build-rsvg-opensuse@x86_64.stable:
extends:
- '.container.opensuse@x86_64.stable'
- .fdo.distribution-image@opensuse
- .build-rsvg-full
# make check runs extra tests that require extra crates, hence cache is pushed
- .cache_push
needs:
- job: opensuse-container@x86_64.stable
artifacts: false
- job: check
artifacts: false
build-rsvg-opensuse@x86_64.minimum:
extends:
- '.container.opensuse@x86_64.minimum'
- .fdo.distribution-image@opensuse
- .build-rsvg-no-docs
needs:
- job: opensuse-container@x86_64.minimum
artifacts: false
- job: check
artifacts: false
build-rsvg-opensuse@x86_64.nightly:
extends:
- '.container.opensuse@x86_64.nightly'
- .fdo.distribution-image@opensuse
- .build-rsvg-no-docs
needs:
- job: opensuse-container@x86_64.nightly
artifacts: false
- job: check
artifacts: false
.build-rsvg-opensuse@aarch64:
extends:
- .container.opensuse@aarch64
- .fdo.distribution-image@opensuse
- .build-rsvg-no-docs
needs:
- job: opensuse-container@aarch64
artifacts: false
- job: check
artifacts: false
build-rsvg-fedora@x86_64:
extends:
- .container.fedora@x86_64
- .fdo.distribution-image@fedora
- .build-rsvg-no-docs
needs:
- job: fedora-container@x86_64
artifacts: false
- job: check
artifacts: false
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "schedule"'
.build-rsvg-fedora@aarch64:
extends:
- .container.fedora@aarch64
- .fdo.distribution-image@fedora
- .build-rsvg-no-docs
needs:
- job: fedora-container@aarch64
artifacts: false
- job: check
artifacts: false
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "schedule"'
.build-rsvg-debian@x86_64:
extends:
- '.container.debian@x86_64'
- '.fdo.distribution-image@debian'
- '.build-rsvg-no-docs'
variables:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907306
# export GDK_PIXBUF_QUERYLOADERS=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders
GDK_PIXBUF_QUERYLOADERS: '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders'
LIBRSVG_DEBUG: "no"
needs:
- job: debian-container@x86_64
artifacts: false
- job: check
artifacts: false
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "schedule"'
.build-rsvg-debian@aarch64:
extends:
- '.container.debian@aarch64'
- '.fdo.distribution-image@debian'
- '.build-rsvg-no-docs'
variables:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907306
# export GDK_PIXBUF_QUERYLOADERS=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders
GDK_PIXBUF_QUERYLOADERS: '/usr/lib/aarch64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders'
LIBRSVG_DEBUG: "no"
needs:
- job: debian-container@aarch64
artifacts: false
- job: check
artifacts: false
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
when: manual
allow_failure: true
- if: '$CI_PIPELINE_SOURCE == "schedule"'
.cache:
variables:
# Only stuff inside the repo directory can be cached
# Override the CARGO_HOME variable to force its location
CARGO_HOME: "${CI_PROJECT_DIR}/cargo_cache"
before_script:
- source ./ci/env.sh
- mkdir -p cargo_cache
cache:
key:
files:
- Cargo.lock
paths:
# Rust cache
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
- cargo_cache/bin
- cargo_cache/registry/index
- cargo_cache/registry/cache
- cargo_cache/git/db
policy: pull
.cache_push:
extends: .cache
cache:
policy: pull-push
fmt:
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache'
stage: lint
needs:
- job: check
script:
- cargo fmt --all -- --check
clippy:
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache'
stage: lint
needs:
- job: check
script:
- cargo clippy --version
- gitlab-clippy --version
- cargo clippy
- cargo clippy --message-format=json | gitlab-clippy -o gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json
expire_in: 1 week
rules:
- if: '$CODE_QUALITY_DISABLED'
when: never
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG'
- if: '$CI_COMMIT_BRANCH'
coverage:
extends:
- '.container.opensuse@x86_64.stable'
- .fdo.distribution-image@opensuse
- .cache
stage: analysis
needs:
- job: opensuse-container@x86_64.stable
- job: check
artifacts: false
variables:
# Mixed gcc and Rust/LLVM coverage for the C API tests:
# https://searchfox.org/mozilla-central/source/browser/config/mozconfigs/linux64/code-coverage#15
CC: "clang"
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
# RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "coverage-profiles/coverage-%p-%m.profraw"
LDFLAGS: "--coverage -L/usr/lib64/clang/14.0.6/lib/linux"
LIBS: "-lclang_rt.profile-x86_64"
RUSTC_BOOTSTRAP: "1" # hack to make -Zprofile work on the non-nightly compiler
CARGO_INCREMENTAL: "0" # -Zprofile (gcov) doesn't like incremental compilation
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Clink-dead-code -Coverflow-checks=off"
script:
- mkdir -p _build
- cd _build
- ../autogen.sh --disable-gtk-doc --disable-vala --enable-debug
- make
- make -k check
after_script:
- source ./ci/env.sh
- bash -x ./ci/gen-coverage.sh
coverage: '/Coverage: \d+\.\d+/'
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 2 days
when: always
# Disable the cobertura report for now; it is only used for showing coverage
# in the diff view of merge requests.
#
# After switching to gcov-based instrumentation (-Zprofile above), this
# coverage.xml is almost 500 MB and causes gitlab's redis to OOM.
#
# reports:
# coverage_report:
# coverage_format: cobertura
# path: coverage.xml
paths:
- public
cargo_bench:
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache'
stage: analysis
needs:
- job: check
script: |
BENCHES=("box_blur" "composite" "lighting" "path_parser" "pixbuf_from_surface" "pixel_iterators" "pixel_ops" "srgb" "surface_from_pixbuf")
git checkout ${CI_DEFAULT_BRANCH}
for BENCH in "${BENCHES[@]}"
do
cargo bench --bench $BENCH -- --noplot --save-baseline main
done
git checkout ${CI_COMMIT_SHA}
for BENCH in "${BENCHES[@]}"
do
cargo bench --bench $BENCH -- --noplot --baseline main
done
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH != "main"'
when: manual
allow_failure: true
artifacts:
paths:
- target/criterion
expire_in: 1 week
msys2-mingw64:
stage: acceptance test
tags:
- win32-ps
needs:
- job: check
variables:
MSYSTEM: "MINGW64"
CHERE_INVOKING: "yes"
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu
- C:\msys64\usr\bin\bash -lc "bash -x ./ci/test-msys2.sh"
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
- if: '$CI_PIPELINE_SOURCE == "schedule"'
distcheck:
stage: acceptance test
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache'
needs:
- job: check
artifacts: false
variables:
DESTDIR: "/tmp/distcheck"
LIBRSVG_DEBUG: "no"
script:
- ./autogen.sh --enable-vala
- make distcheck
artifacts:
when: 'on_success'
paths:
- librsvg-*.tar.xz
expire_in: 1 week
reference:
stage: docs
needs:
- job: build-rsvg-opensuse@x86_64.stable
artifacts: true
script:
- mkdir -p public/
- mv _build/doc/Rsvg-2.0 public/
artifacts:
paths:
- public
devel-docs:
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache'
stage: docs
needs:
- job: opensuse-container@x86_64.stable
artifacts: false
script:
- bash -x ./ci/gen-devel-docs.sh
artifacts:
paths:
- public
pages:
stage: docs
extends:
- '.container.opensuse@x86_64.stable'
- '.fdo.distribution-image@opensuse'
- '.cache'
needs:
- job: reference
- job: coverage
- job: devel-docs
script:
- mkdir -p public/internals
- cargo doc --document-private-items --no-deps
- cp -r target/doc/* public/internals
- mkdir -p public/doc
- cargo doc --no-deps --lib
- cp -r target/doc/* public/doc
artifacts:
paths:
- public
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
|