13 FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v13"
14 COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v3"
15 DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v9"
16 ANDROID_IMAGE: "registry.gitlab.gnome.org/gnome/glib/android-ndk:v6"
17 MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v5"
18 MESON_TEST_TIMEOUT_MULTIPLIER: 2
20 MESON_COMMON_OPTIONS_NO_WARNING: "--buildtype debug --wrap-mode=nodownload"
21 MESON_COMMON_OPTIONS: "${MESON_COMMON_OPTIONS_NO_WARNING} --fatal-meson-warnings"
29 # Some jobs run on CI runners which don’t have good isolation between CI jobs,
30 # and don’t have much available resource. Limit those jobs to only ones on the
31 # origin repository (GNOME/glib), rather than people’s forks. Code in the origin
32 # repository can be trusted.
39 # Some jobs take a long time and are unlikely to find failures (or will find
40 # failures which are not merge-blockers to fix), so they’re executed on a weekly
41 # schedule in order to save CI resources and speed up branch pipelines.
50 - bash .gitlab-ci/show-execution-environment.sh
51 - cp -r $HOME/subprojects/* subprojects/
54 extends: .only-default
59 - .gitlab-ci/run-style-check-diff.sh
60 - .gitlab-ci/run-shellcheck.sh
61 - .gitlab-ci/run-black.sh
62 - .gitlab-ci/run-flake8.sh
65 extends: .only-default
70 - .gitlab-ci/run-check-todos.sh
80 CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
82 # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc
83 # feature fully functional in 0.54, but we only depend on 0.52. So we cannot build
84 # with --fatal-meson-warnings.
85 - meson ${MESON_COMMON_OPTIONS_NO_WARNING}
87 --default-library=both
88 --prefix=$HOME/glib-installed
93 -Dinstalled_tests=true
98 - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
99 - .gitlab-ci/run-tests.sh
100 - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
103 junit: "_build/${CI_JOB_NAME}-report.xml"
104 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
108 - "_build/glib/glibconfig.h"
109 - "_build/meson-logs"
110 - "_build/docs/reference/glib/glib-undeclared.txt"
111 - "_build/docs/reference/glib/glib-undocumented.txt"
112 - "_build/docs/reference/glib/glib-unused.txt"
113 - "_build/docs/reference/gobject/gobject-undeclared.txt"
114 - "_build/docs/reference/gobject/gobject-undocumented.txt"
115 - "_build/docs/reference/gobject/gobject-unused.txt"
116 - "_build/docs/reference/gio/gio-undeclared.txt"
117 - "_build/docs/reference/gio/gio-undocumented.txt"
118 - "_build/docs/reference/gio/gio-unused.txt"
119 - "_build/${CI_JOB_NAME}-report.xml"
122 debian-stable-x86_64:
130 - meson ${MESON_COMMON_OPTIONS}
132 --default-library=both
133 --prefix=$HOME/glib-installed
139 -Dinstalled_tests=true
142 - .gitlab-ci/run-tests.sh
145 junit: "_build/${CI_JOB_NAME}-report.xml"
146 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
150 - "_build/glib/glibconfig.h"
151 - "_build/meson-logs"
152 - "_build/${CI_JOB_NAME}-report.xml"
162 # dtrace is disabled because it breaks the static-link.py test
163 - meson ${MESON_COMMON_OPTIONS}
165 --prefix=/usr --libdir=/usr/lib64
166 -Dinstalled_tests=true
167 -Ddefault_library=both
171 - sudo ninja -C _build install
172 # Remove old headers, possibly present in current installation
173 - sudo rm -f /usr/include/glib-2.0/glib/gurifuncs.h
174 - sudo chown -R `id -un`:`id -gn` _build/
175 # Work-around https://gitlab.gnome.org/GNOME/gnome-desktop-testing/merge_requests/2
176 - mkdir -p _build/installed-tests-report/logs/
177 - GLIB_TEST_COMPILATION=1 gnome-desktop-testing-runner
178 --report-directory=_build/installed-tests-report/failed/
179 --log-directory=_build/installed-tests-report/logs/
183 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
187 - "_build/glib/glibconfig.h"
188 - "_build/meson-logs"
189 - "_build/installed-tests-report/"
199 - meson ${MESON_COMMON_OPTIONS}
203 -Dinstalled_tests=true
207 - bash -x ./.gitlab-ci/run-tests.sh
210 junit: "_build/${CI_JOB_NAME}-report.xml"
211 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
215 - "_build/glib/glibconfig.h"
216 - "_build/meson-logs"
217 - "_build/${CI_JOB_NAME}-report.xml"
227 MESON_TEST_TIMEOUT_MULTIPLIER: 10
229 - meson ${MESON_COMMON_OPTIONS}
233 -Dinstalled_tests=true
236 - bash -x ./.gitlab-ci/run-tests.sh
237 --log-file _build/meson-logs/testlog-valgrind.json
238 --wrap "valgrind --tool=memcheck --error-exitcode=1 --track-origins=yes --leak-check=full --leak-resolution=high --num-callers=50 --show-leak-kinds=definite,possible --show-error-list=yes --suppressions=${CI_PROJECT_DIR}/glib.supp"
239 --no-suite no-valgrind
241 # FIXME: Remove this when we have zero valgrind leaks.
242 # https://gitlab.gnome.org/GNOME/glib/issues/333
246 junit: "_build/${CI_JOB_NAME}-report.xml"
247 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
251 - "_build/glib/glibconfig.h"
252 - "_build/meson-logs"
255 extends: .build-linux
259 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
262 - "_build/meson-logs"
264 cross-android_api28_arm64:
268 image: $ANDROID_IMAGE
270 # FIXME: add --werror
271 - meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_28.txt _build
280 # FIXME: Add --werror
281 - meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
285 junit: "_build/${env:CI_JOB_NAME}-report.xml"
286 name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
290 - "_build/${env:CI_JOB_NAME}-report.xml"
291 - _build/glib/libglib-2.0-0.dll
292 - _build/gio/libgio-2.0-0.dll
293 - _build/gmodule/libgmodule-2.0-0.dll
294 - _build/gthread/libgthread-2.0-0.dll
295 - _build/gobject/libgobject-2.0-0.dll
298 extends: .only-default
305 CHERE_INVOKING: "yes"
307 - C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
308 - C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
309 - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
312 junit: "_build/${env:CI_JOB_NAME}-report.xml"
313 name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
317 - "_build/${env:CI_JOB_NAME}-report.xml"
321 extends: .only-default
327 # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
328 # aren’t currently set up for that.
329 - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} --wrap-mode=default
332 junit: "_build/${env:CI_JOB_NAME}-report.xml"
333 name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
337 - "_build/${env:CI_JOB_NAME}-report.xml"
338 - _build/glib/libglib-2.0-0.dll
339 - _build/gio/libgio-2.0-0.dll
340 - _build/gmodule/libgmodule-2.0-0.dll
341 - _build/gthread/libgthread-2.0-0.dll
342 - _build/gobject/libgobject-2.0-0.dll
345 extends: .only-default
351 # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
352 # aren’t currently set up for that.
353 - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} --wrap-mode=default --default-library=static
356 junit: "_build/${env:CI_JOB_NAME}-report.xml"
357 name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
361 - "_build/${env:CI_JOB_NAME}-report.xml"
364 # The FreeBSD 13 build is run on each commit, so the FreeBSD 12 build can be
365 # run less regularly to save CI resources. The chance of a regression on
366 # FreeBSD 12 and not FreeBSD 13 is tiny.
367 extends: .only-schedules
370 # To run a FreeBSD builder, install gitlab-runner package and start both
371 # gitlab-runner and dbus service because we need /var/lib/dbus/machine-id.
372 # To compile GLib, you still have to install the following packages:
373 # desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info
377 # CPPFLAGS is required because libintl doesn't use pkg-config.
378 CPPFLAGS: -I/usr/local/include
379 # FIXME: Workaround meson inability to set LD_LIBRARY_PATH.
380 # https://github.com/mesonbuild/meson/issues/1383
381 # https://github.com/mesonbuild/meson/issues/1635
382 # https://github.com/mesonbuild/meson/issues/2881
383 LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
384 # FreeBSD supports C.UTF-8 locale since 12.1.
387 - bash .gitlab-ci/show-execution-environment.sh
389 # We cannot use -Wl,--no-undefined because GLib uses 'environ' variable.
390 # FreeBSD iconv doesn't handle transliteration, so we use (external) GNU libiconv here.
391 # FreeBSD supports xattr, but its API is different from Linux xattr.
392 # FIXME: extattr(2) support: https://gitlab.gnome.org/GNOME/glib/issues/1404
393 # localstatedir is needed for access to /var/lib/dbus/machine-id
394 - meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Diconv=external -Dxattr=false _build
396 - bash -x ./.gitlab-ci/run-tests.sh
399 junit: "_build/${CI_JOB_NAME}-report.xml"
400 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
404 - "_build/glib/glibconfig.h"
405 - "_build/meson-logs"
406 - "_build/${CI_JOB_NAME}-report.xml"
409 extends: .only-origin
415 CPPFLAGS: -I/usr/local/include
416 LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
419 - bash .gitlab-ci/show-execution-environment.sh
421 - meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Diconv=external -Dxattr=false _build
423 - bash -x ./.gitlab-ci/run-tests.sh
426 junit: "_build/${CI_JOB_NAME}-report.xml"
427 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
431 - "_build/glib/glibconfig.h"
432 - "_build/meson-logs"
433 - "_build/${CI_JOB_NAME}-report.xml"
436 extends: .only-origin
442 - bash .gitlab-ci/show-execution-environment.sh
443 - pip3 install --user meson==0.60.1
444 - pip3 install --user ninja
445 - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
447 # FIXME: Use --wrap-mode=default so we download dependencies each time,
448 # until the macOS runner is a VM where we can use a pre-made image which
449 # already contains the dependencies. See:
450 # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
451 # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225
452 - meson ${MESON_COMMON_OPTIONS}
457 - .gitlab-ci/run-tests.sh
460 junit: "_build/${CI_JOB_NAME}-report.xml"
461 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
465 - "_build/glib/glibconfig.h"
466 - "_build/meson-logs"
467 - "_build/${CI_JOB_NAME}-report.xml"
470 extends: .only-default
473 needs: ['fedora-x86_64', 'msys2-mingw32']
475 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
479 - bash .gitlab-ci/show-execution-environment.sh
481 - bash -x ./.gitlab-ci/coverage-docker.sh
482 coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
492 - meson ${MESON_COMMON_OPTIONS}
494 --default-library=both
495 --prefix=$HOME/glib-installed
500 -Dinstalled_tests=true
502 - ninja -C _scan_build scan-build
504 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
507 - "_scan_build/meson-logs/scanbuild"
513 image: $COVERITY_IMAGE
517 # cov-build doesn’t like GLIB_DEPRECATED_ENUMERATOR
518 CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
520 - meson ${MESON_COMMON_OPTIONS}
522 --default-library=both
523 --prefix=$HOME/glib-installed
528 -Dinstalled_tests=true
530 - $HOME/cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C _coverity_build
531 - tar cfz cov-int.tar.gz cov-int
532 - curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
533 --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
534 --form file=@cov-int.tar.gz --form version="$CI_COMMIT_SHA"
535 --form description="$CI_COMMIT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
537 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
540 - "cov-int/build-log.txt"
546 needs: ['coverage', 'style-check-diff']
548 - mv _coverage/ public/
559 # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc
560 # feature fully functional in 0.54, but we only depend on 0.52. So we cannot build
561 # with --fatal-meson-warnings.
562 - meson ${MESON_COMMON_OPTIONS_NO_WARNING} --buildtype release -Dgtk_doc=true -Dman=true _build
565 - ninja glib-doc gobject-doc gio-doc
566 - tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
567 - tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
568 - tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
571 - "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"
572 - "${CI_PROJECT_DIR}/_build/gobject-docs-$CI_COMMIT_TAG.tar.xz"
573 - "${CI_PROJECT_DIR}/_build/gio-docs-$CI_COMMIT_TAG.tar.xz"
574 - "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"