forked from GNOME/glib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
828 lines (792 loc) · 25 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
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
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
stages:
- style-check
- build
- coverage
- analysis
- deploy
- report
cache:
paths:
- _ccache/
variables:
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v26"
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v19"
ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v3"
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v15"
MESON_TEST_TIMEOUT_MULTIPLIER: 4
G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
# Default CI job setup; contrast with `.only-origin`.
#
# Don’t execute the pipeline when a merge request is merged into `origin/main`,
# as it will have already been tested
.only-default:
only:
- branches
except:
refs:
- tags
variables:
- $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PROJECT_NAMESPACE == "GNOME"
# As above, but does get executed on merge into `origin/main`. For use with
# updating code coverage results and docs builds.
.only-default-and-merges:
only:
- branches
except:
refs:
- tags
# Some jobs run on CI runners which don’t have good isolation between CI jobs,
# and don’t have much available resource. Limit those jobs to only ones on the
# origin repository (GNOME/glib), rather than people’s forks. Code in the origin
# repository can be trusted.
.only-origin:
only:
- branches@GNOME/glib
except:
- tags
# Some jobs take a long time and are unlikely to find failures (or will find
# failures which are not merge-blockers to fix), so they’re executed on a weekly
# schedule in order to save CI resources and speed up branch pipelines.
.only-schedules:
only:
- schedules
except:
- tags
# Some jobs take a long time and are unlikely to find failures (or will find
# failures which are not merge-blockers to fix), so they’re executed on a weekly
# schedule in order to save CI resources and speed up branch pipelines.
# But for specific merge requests, one may still want to run them, so make
# possible to run them manually.
.only-schedules-or-manual:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
# As per rule before, the following rules will only apply to non MR events
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- if: $CI_PIPELINE_SOURCE != "schedule"
when: manual
allow_failure: true
# Some jobs should be runnable only on schedules and when triggered by a branch
# in the origin repository, but without
.only-schedules-or-manual-in-default-branch:
rules:
- if: $CI_PROJECT_PATH != "GNOME/glib" || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
when: never
# As per rule before, the following rules will apply only to GNOME/glib:main
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- if: $CI_PIPELINE_SOURCE != "schedule"
when: manual
allow_failure: true
# Some jobs run on CI runners don’t have much available resource.
# Limit those jobs to only ones on the origin repository (GNOME/glib),
# rather than people’s forks or if ran manually.
.only-origin-or-manual:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_PROJECT_NAMESPACE == "GNOME"
when: always
- if: $CI_PROJECT_NAMESPACE != "GNOME"
when: manual
allow_failure: true
.build-linux:
before_script:
- bash .gitlab-ci/show-execution-environment.sh
- cp -r $HOME/subprojects/* subprojects/
# FIXME: Work around https://gitlab.com/gitlab-org/gitlab/-/issues/391756
.with-git:
before_script:
- rm -rf subprojects/gvdb
- git config --global --add safe.directory "${PWD}"
- git submodule update --init --depth 1
variables:
GIT_SUBMODULE_STRATEGY: "none"
GIT_SUBMODULE_DEPTH: 1
style-check-advisory:
extends:
- .only-default
- .with-git
image: $DEBIAN_IMAGE
stage: style-check
allow_failure: true
script:
- failed=
- .gitlab-ci/run-style-check-diff.sh || failed=1
- .gitlab-ci/run-check-todos.sh || failed=1
- test -z "$failed"
sh-and-py-check:
extends:
- .only-default
- .with-git
image: $DEBIAN_IMAGE
stage: style-check
allow_failure: false
script:
- failed=
- tests/shellcheck.sh || failed=1
- tests/black.sh || failed=1
- tests/flake8.sh || failed=1
- test -z "$failed"
variables:
LINT_WARNINGS_ARE_ERRORS: '1'
only:
changes:
- "**/*.py"
- "**/*.sh"
style-check-mandatory:
extends:
- .only-default
- .with-git
image: $DEBIAN_IMAGE
stage: style-check
allow_failure: false
script:
- tests/reuse.sh
variables:
LINT_WARNINGS_ARE_ERRORS: '1'
fedora-x86_64:
extends:
- .build-linux
- .only-default-and-merges
- .with-git
image: $FEDORA_IMAGE
stage: build
needs: []
variables:
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
before_script:
- !reference [".build-linux", "before_script"]
- !reference [".with-git", "before_script"]
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Ddocumentation=true
-Dintrospection=enabled
-Dman-pages=enabled
_build
- meson compile -C _build
- mkdir -p _coverage
- lcov --config-file .lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
- .gitlab-ci/run-tests.sh
- lcov --config-file .lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
# Copy the built documentation to an artifact directory. The build for docs.gtk.org
# can then pull it from there — see https://gitlab.gnome.org/GNOME/gtk/-/blob/docs-gtk-org/README.md
- mkdir -p _reference/
- mv _build/docs/reference/glib/glib-2.0/ _reference/glib/
- mv _build/docs/reference/glib/glib-unix-2.0/ _reference/glib-unix/
- mv _build/docs/reference/gmodule/gmodule-2.0/ _reference/gmodule/
- mv _build/docs/reference/gobject/gobject-2.0/ _reference/gobject/
- mv _build/docs/reference/gio/gio-2.0/ _reference/gio/
- mv _build/docs/reference/gio/gio-unix-2.0/ _reference/gio-unix/
- mv _build/docs/reference/girepository/girepository-2.0/ _reference/girepository/
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
- "_coverage"
- "_reference"
debian-stable-x86_64:
extends:
- .build-linux
- .only-default
- .with-git
image: $DEBIAN_IMAGE
stage: build
needs: []
before_script:
- !reference [".build-linux", "before_script"]
- !reference [".with-git", "before_script"]
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
hurd-i386:
extends:
- .only-schedules-or-manual
- .with-git
stage: build
tags:
- hurd
needs: []
script:
# FIXME: We can’t use ${MESON_COMMON_OPTIONS} here because the Hurd runner
# has Meson 1.3 installed. See the comment below about the same problem on
# FreeBSD.
- meson setup
--buildtype debug
--wrap-mode=nodownload
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
muslc-alpine-x86_64:
extends:
- .build-linux
- .only-schedules-or-manual
- .with-git
image: $ALPINE_IMAGE
stage: build
needs: []
before_script:
- !reference [".build-linux", "before_script"]
- !reference [".with-git", "before_script"]
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
installed-tests:
extends:
- .build-linux
- .only-schedules-or-manual
image: $FEDORA_IMAGE
stage: build
needs: []
script:
# dtrace is disabled because it breaks the static-link.py test
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--prefix=/usr --libdir=/usr/lib64
-Dinstalled_tests=true
-Ddefault_library=both
-Ddtrace=false
_build
- meson compile -C _build
- sudo meson install -C _build
# Remove old headers, possibly present in current installation
- sudo rm -f /usr/include/glib-2.0/glib/gurifuncs.h
- sudo chown -R `id -un`:`id -gn` _build/
# Work-around https://gitlab.gnome.org/GNOME/gnome-desktop-testing/merge_requests/2
- mkdir -p _build/installed-tests-report/logs/
- GLIB_TEST_COMPILATION=1 gnome-desktop-testing-runner
--report-directory=_build/installed-tests-report/failed/
--log-directory=_build/installed-tests-report/logs/
--parallel=0
glib
artifacts:
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
- "_build/installed-tests-report/"
G_DISABLE_ASSERT:
extends:
- .build-linux
- .only-schedules-or-manual
- .with-git
image: $FEDORA_IMAGE
stage: build
needs: []
variables:
MESON_TEST_TIMEOUT_MULTIPLIER: 15
before_script:
- !reference [".build-linux", "before_script"]
- !reference [".with-git", "before_script"]
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Dglib_assert=false
-Dintrospection=enabled
_build
- meson compile -C _build
# Also take the opportunity to run the thorough tests (which are slow)
- bash -x ./.gitlab-ci/run-tests.sh --setup thorough
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
valgrind:
extends:
- .build-linux
- .only-schedules-or-manual
- .with-git
image: $FEDORA_IMAGE
stage: analysis
needs: []
variables:
MESON_TEST_TIMEOUT_MULTIPLIER: 15
before_script:
- !reference [".build-linux", "before_script"]
- !reference [".with-git", "before_script"]
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Dintrospection=enabled
_build
- meson compile -C _build
# Valgrind doesn’t work when the soft FD limit is set too high
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2710
- ulimit -Sn 1024
- bash -x ./.gitlab-ci/run-tests.sh
--setup valgrind
--no-suite slow
artifacts:
reports:
junit: "_build/meson-logs/testlog-valgrind.junit.xml"
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
.cross-build-linux:
extends: .build-linux
stage: build
needs: []
artifacts:
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/meson-logs"
cross-android_arm64:
extends:
- .cross-build-linux
- .only-default
image: $FEDORA_IMAGE
script:
# FIXME: add --werror
- meson setup ${MESON_COMMON_OPTIONS} --cross-file=.gitlab-ci/cross_file_android_arm64_31.txt _build
- meson compile -C _build
cross-mingw64:
extends:
- .cross-build-linux
- .only-default
image: $MINGW_IMAGE
variables:
PYTHONUTF8: "1"
script:
# FIXME: Add --werror
- meson setup ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
- meson compile -C _build
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
- _build/glib/libglib-2.0-0.dll
- _build/gio/libgio-2.0-0.dll
- _build/gmodule/libgmodule-2.0-0.dll
- _build/gthread/libgthread-2.0-0.dll
- _build/gobject/libgobject-2.0-0.dll
msys2-mingw32:
extends: .only-default-and-merges
stage: build
tags:
- win32-ps
needs: []
variables:
MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes"
CFLAGS: -coverage -ftest-coverage -fprofile-arcs
PYTHONUTF8: "1"
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
- _coverage/
- _reference/
msys2-clang64:
extends: .only-schedules-or-manual
stage: build
tags:
- win32-ps
needs: []
variables:
MSYSTEM: "CLANG64"
CHERE_INVOKING: "yes"
PYTHONUTF8: "1"
script:
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
artifacts:
reports:
junit: "_build/meson-logs/testlog.junit.xml"
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
vs2017-x64:
extends: .only-default
stage: build
tags:
- win32-ps
needs: []
variables:
PYTHONUTF8: "1"
script:
# FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
# aren’t currently set up for that.
- .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS}
--wrap-mode=default
--python.platlibdir=C:\Python37\site-packages
--python.purelibdir=C:\Python37\site-packages
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
- _build/glib/libglib-2.0-0.dll
- _build/gio/libgio-2.0-0.dll
- _build/gmodule/libgmodule-2.0-0.dll
- _build/gthread/libgthread-2.0-0.dll
- _build/gobject/libgobject-2.0-0.dll
vs2017-x64-static:
extends: .only-default
stage: build
tags:
- win32-ps
needs: []
variables:
PYTHONUTF8: "1"
script:
# FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
# aren’t currently set up for that.
- .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS}
--wrap-mode=default
--default-library=static
--python.platlibdir=C:\Python37\site-packages
--python.purelibdir=C:\Python37\site-packages
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
freebsd-13-x86_64:
extends: .only-origin-or-manual
stage: build
tags:
- freebsd-13
needs: []
variables:
CPPFLAGS: -I/usr/local/include
LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
LANG: C.UTF-8
before_script:
- bash .gitlab-ci/show-execution-environment.sh
script:
# FIXME: We can’t use ${MESON_COMMON_OPTIONS} here because the FreeBSD 13
# runner has Meson 1.3 installed. This has an API hole where previous
# methods of getting paths from files() objects are rejected as deprecated,
# but no replacements are available. Hence, we can’t build with
# --fatal-meson-warnings. This should be fixed in Meson 1.4. It’s also fine
# with Meson 1.2.3 (which is what we use on all the other CI runners).
# See https://github.com/GNOME/glib/commit/71061fdcb33b8c26f5f8467cb3ac10704d65c87d
- meson setup --buildtype debug --wrap-mode=nodownload --localstatedir=/var -Db_lundef=false -Dxattr=false _build
- meson compile -C _build
- bash -x ./.gitlab-ci/run-tests.sh
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
macos-x86_64:
# The macOS runner is not allowed in forks. This is about trust, not capacity.
extends: .only-origin
stage: build
tags:
- macosintel
needs: []
cache: []
variables:
GIT_SUBMODULE_STRATEGY: normal
# -Wno-overlength-strings
# libpcre2 gets built as a subproject, but the default Clang options on
# macOS limit string lengths to 4095B — pcre2_error.c has a string of length
# 4380B
CFLAGS: "-Wno-overlength-strings"
# redirect to the runner's volatile temporary directory
TMPDIR: /Users/Shared/work/tmp
# keep the user profile clean
PIP_CACHE_DIR: /Users/Shared/build/cache
PIPENV_CACHE_DIR: $PIP_CACHE_DIR
PYTHONPYCACHEPREFIX: $PIP_CACHE_DIR
# target OS X 10.9 Mavericks for backward compatibility
SDKROOT: /opt/sdks/MacOSX10.9.sdk
# use the runner's ccache directory
CCACHE_DIR: /Users/Shared/work/ccache
before_script:
- bash .gitlab-ci/show-execution-environment.sh
- python3 -m venv .venv
- ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin
- ln -s /opt/ccache/ccache .venv/bin
- source .venv/bin/activate
- pip3 install meson==1.2.3
- pip3 install ninja==1.11.1
- pip3 install packaging==23.2
script:
# FIXME: Use --wrap-mode=default so we download dependencies each time,
# until the macOS runner is a VM where we can use a pre-made image which
# already contains the dependencies. See:
# - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
# - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225
- meson setup ${MESON_COMMON_OPTIONS}
--wrap-mode=default
--werror
_build
- meson compile -C _build
- .gitlab-ci/run-tests.sh
artifacts:
reports:
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
coverage:
extends: .only-default
image: $FEDORA_IMAGE
stage: coverage
needs: ['fedora-x86_64', 'msys2-mingw32']
artifacts:
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
expire_in: 1 week
expose_as: 'Coverage Report'
paths:
- _coverage/coverage/index.html
- _coverage
reports:
coverage_report:
coverage_format: cobertura
path: _coverage/*-cobertura/cobertura-*.xml
before_script:
- bash .gitlab-ci/show-execution-environment.sh
script:
- bash -x ./.gitlab-ci/coverage-docker.sh
coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
scan-build:
extends:
- .build-linux
- .only-schedules-or-manual
image: $FEDORA_IMAGE
stage: analysis
needs: []
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Dintrospection=enabled
_scan_build
- ninja -C _scan_build scan-build
artifacts:
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "_scan_build/meson-logs/scanbuild"
.coverity:
extends:
- .build-linux
- .only-schedules-or-manual-in-default-branch
image: $COVERITY_IMAGE
stage: analysis
needs: []
variables:
# cov-build doesn’t like GLIB_DEPRECATED_ENUMERATOR
CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
script:
- meson setup ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Dintrospection=enabled
_coverity_build
- $HOME/cov-analysis-linux64-*/bin/cov-build --dir cov-int meson compile -C _coverity_build
- tar cfz cov-int.tar.gz cov-int
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
--form file=@cov-int.tar.gz --form version="$CI_COMMIT_SHA"
--form description="$CI_COMMIT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
artifacts:
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- "cov-int/build-log.txt"
pages:
extends: .only-schedules
stage: deploy
needs: ['coverage', 'style-check-advisory']
script:
- mv _coverage/ public/
artifacts:
paths:
- public
dist-job:
image: $FEDORA_IMAGE
stage: build
only:
- tags
script:
# Ignore extra git security checks as we don't care in CI.
- git config --global --add safe.directory "${PWD}"
- git submodule update --init
- for m in $(git submodule foreach -q 'echo $path'); do git config --global --add safe.directory "${PWD}/${m}"; done
- meson subprojects download
- meson setup ${MESON_COMMON_OPTIONS} --buildtype release -Ddocumentation=true -Dman-pages=enabled _build
- meson dist -C _build
# Compile again to build the docs
- meson compile -C _build
- tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/glib glib-2.0
- tar -c -J -f "gmodule-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/gmodule gmodule-2.0
- tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/gobject gobject-2.0
- tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/gio gio-2.0
- tar -c -J -f "girepository-docs-$CI_COMMIT_TAG.tar.xz" -C _build/docs/reference/girepository girepository-2.0
artifacts:
paths:
- "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/gmodule-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/gobject-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/gio-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/girepository-docs-$CI_COMMIT_TAG.tar.xz"
- "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"
issue-bot:
stage: report
image: registry.gitlab.com/gitlab-org/distribution/issue-bot:latest
script: /issue-bot
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule"
when: on_failure