13 FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v10"
14 COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v1"
15 DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v7"
16 ANDROID_IMAGE: "registry.gitlab.gnome.org/gnome/glib/android-ndk:v3"
17 MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v2"
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"
30 extends: .only-default
32 - bash .gitlab-ci/show-execution-environment.sh
33 - cp -r $HOME/subprojects/* subprojects/
35 # Some jobs take a long time and are unlikely to find failures (or will find
36 # failures which are not merge-blockers to fix), so they’re executed on a weekly
37 # schedule in order to save CI resources and speed up branch pipelines.
38 .build-only-schedules:
44 extends: .only-default
49 - .gitlab-ci/run-style-check-diff.sh
50 - .gitlab-ci/run-shellcheck.sh
51 - .gitlab-ci/run-black.sh
52 - .gitlab-ci/run-flake8.sh
55 extends: .only-default
60 - .gitlab-ci/run-check-todos.sh
68 CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
70 # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc
71 # feature introduced in 0.52 but we only depends on 0.49. So we cannot build
72 # with --fatal-meson-warnings.
73 - meson ${MESON_COMMON_OPTIONS_NO_WARNING}
75 --default-library=both
76 --prefix=$HOME/glib-installed
82 -Dinstalled_tests=true
87 - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
88 - .gitlab-ci/run-tests.sh
89 - lcov --config-file .gitlab-ci/lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
92 junit: "_build/${CI_JOB_NAME}-report.xml"
93 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
97 - "_build/glib/glibconfig.h"
99 - "_build/docs/reference/glib/glib-undeclared.txt"
100 - "_build/docs/reference/glib/glib-undocumented.txt"
101 - "_build/docs/reference/glib/glib-unused.txt"
102 - "_build/docs/reference/gobject/gobject-undeclared.txt"
103 - "_build/docs/reference/gobject/gobject-undocumented.txt"
104 - "_build/docs/reference/gobject/gobject-unused.txt"
105 - "_build/docs/reference/gio/gio-undeclared.txt"
106 - "_build/docs/reference/gio/gio-undocumented.txt"
107 - "_build/docs/reference/gio/gio-unused.txt"
108 - "_build/${CI_JOB_NAME}-report.xml"
111 debian-stable-x86_64:
117 - meson ${MESON_COMMON_OPTIONS}
119 --default-library=both
120 --prefix=$HOME/glib-installed
126 -Dinstalled_tests=true
129 - .gitlab-ci/run-tests.sh
132 junit: "_build/${CI_JOB_NAME}-report.xml"
133 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
137 - "_build/glib/glibconfig.h"
138 - "_build/meson-logs"
139 - "_build/${CI_JOB_NAME}-report.xml"
142 extends: .build-only-schedules
147 # dtrace is disabled because it breaks the static-link.py test
148 - meson ${MESON_COMMON_OPTIONS}
150 --prefix=/usr --libdir=/usr/lib64
152 -Dinstalled_tests=true
153 -Ddefault_library=both
157 - sudo ninja -C _build install
158 # Remove old headers, possibly present in current installation
159 - sudo rm -f /usr/include/glib-2.0/glib/gurifuncs.h
160 - sudo chown -R `id -un`:`id -gn` _build/
161 # FIXME Install newer xdg-desktop-portal with
162 # GMemoryMonitor support, see:
163 # https://github.com/flatpak/xdg-desktop-portal/pull/365
164 - git clone --branch 1.6.0 --depth 1 --no-tags https://github.com/flatpak/xdg-desktop-portal.git
165 - cd xdg-desktop-portal
166 - ./autogen.sh --prefix=/usr --libdir=/usr/lib64 --disable-libportal --disable-dependency-tracking
170 # FIXME install newer gobject-introspection
171 # with GMemoryMonitor support, see:
172 # https://gitlab.gnome.org/GNOME/gobject-introspection/merge_requests/193
173 - git clone --branch master --depth 1 --no-tags https://gitlab.gnome.org/GNOME/gobject-introspection.git
174 - cd gobject-introspection
175 - /usr/bin/meson _build --prefix=/usr --libdir=/usr/lib64
177 - sudo ninja -C _build install
179 # Work-around https://gitlab.gnome.org/GNOME/gnome-desktop-testing/merge_requests/2
180 - mkdir -p _build/installed-tests-report/logs/
181 - GLIB_TEST_COMPILATION=1 gnome-desktop-testing-runner
182 --report-directory=_build/installed-tests-report/failed/
183 --log-directory=_build/installed-tests-report/logs/
187 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
191 - "_build/glib/glibconfig.h"
192 - "_build/meson-logs"
193 - "_build/installed-tests-report/"
196 extends: .build-only-schedules
201 - meson ${MESON_COMMON_OPTIONS}
206 -Dinstalled_tests=true
210 - bash -x ./.gitlab-ci/run-tests.sh
213 junit: "_build/${CI_JOB_NAME}-report.xml"
214 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
218 - "_build/glib/glibconfig.h"
219 - "_build/meson-logs"
220 - "_build/${CI_JOB_NAME}-report.xml"
223 extends: .build-only-schedules
228 MESON_TEST_TIMEOUT_MULTIPLIER: 10
230 - meson ${MESON_COMMON_OPTIONS}
235 -Dinstalled_tests=true
238 - bash -x ./.gitlab-ci/run-tests.sh
239 --log-file _build/meson-logs/testlog-valgrind.json
240 --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"
241 --no-suite no-valgrind
243 # FIXME: Remove this when we have zero valgrind leaks.
244 # https://gitlab.gnome.org/GNOME/glib/issues/333
248 junit: "_build/${CI_JOB_NAME}-report.xml"
249 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
253 - "_build/glib/glibconfig.h"
254 - "_build/meson-logs"
256 .cross-template: &cross-template
261 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
264 - "_build/meson-logs"
266 cross-android_api21_arm64:
268 image: $ANDROID_IMAGE
270 # FIXME: add --werror
271 # We use -Diconv=auto to test that we successfully detect that iconv is not
272 # provided by android api 21, and detect the external iconv instead.
273 - meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_21.txt -Diconv=auto -Dinternal_pcre=true _build
276 cross-android_api28_arm64:
278 image: $ANDROID_IMAGE
280 # FIXME: add --werror
281 - meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_28.txt -Dinternal_pcre=true _build
288 # FIXME: Add --werror
289 - meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
293 extends: .only-default
300 CHERE_INVOKING: "yes"
302 - C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
303 - C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
304 - C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
307 junit: "_build/${env:CI_JOB_NAME}-report.xml"
308 name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
312 - "_build/${env:CI_JOB_NAME}-report.xml"
316 extends: .only-default
322 - .gitlab-ci/test-msvc.bat
325 junit: "_build/${env:CI_JOB_NAME}-report.xml"
326 name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
330 - "_build/${env:CI_JOB_NAME}-report.xml"
335 - branches@GNOME/glib
337 # To run a FreeBSD builder, install gitlab-runner package and start both
338 # gitlab-runner and dbus service because we need /var/lib/dbus/machine-id.
339 # To compile GLib, you still have to install the following packages:
340 # desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info
344 # CPPFLAGS is required because libintl doesn't use pkg-config.
345 CPPFLAGS: -I/usr/local/include
346 # FIXME: Workaround meson inability to set LD_LIBRARY_PATH.
347 # https://github.com/mesonbuild/meson/issues/1383
348 # https://github.com/mesonbuild/meson/issues/1635
349 # https://github.com/mesonbuild/meson/issues/2881
350 LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
351 # FreeBSD doesn't have C.UTF-8 locale.
354 - bash .gitlab-ci/show-execution-environment.sh
356 # We cannot use -Wl,--no-undefined because GLib uses 'environ' variable.
357 # FreeBSD iconv doesn't handle transliteration, so we use (external) GNU libiconv here.
358 # FreeBSD supports xattr, but its API is different from Linux xattr.
359 # FIXME: extattr(2) support: https://gitlab.gnome.org/GNOME/glib/issues/1404
360 # localstatedir is needed for access to /var/lib/dbus/machine-id
361 - meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Diconv=external -Dxattr=false _build
363 - bash -x ./.gitlab-ci/run-tests.sh
366 junit: "_build/${CI_JOB_NAME}-report.xml"
367 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
371 - "_build/glib/glibconfig.h"
372 - "_build/meson-logs"
373 - "_build/${CI_JOB_NAME}-report.xml"
378 - branches@GNOME/glib
383 CPPFLAGS: -I/usr/local/include
384 LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
387 - bash .gitlab-ci/show-execution-environment.sh
389 - meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Diconv=external -Dxattr=false _build
391 - bash -x ./.gitlab-ci/run-tests.sh
396 junit: "_build/${CI_JOB_NAME}-report.xml"
397 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
401 - "_build/glib/glibconfig.h"
402 - "_build/meson-logs"
403 - "_build/${CI_JOB_NAME}-report.xml"
406 extends: .only-default
409 - branches@GNOME/glib
414 - bash .gitlab-ci/show-execution-environment.sh
415 - pip3 install --user meson==0.49.2
416 - pip3 install --user ninja
417 - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
419 # FIXME: Add --werror
420 # FIXME: Use --wrap-mode=default so we download dependencies each time,
421 # until the macOS runner is a VM where we can use a pre-made image which
422 # already contains the dependencies. See:
423 # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
424 # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225
425 - meson ${MESON_COMMON_OPTIONS}
429 # FIXME: Multiple unit tests currently fails
430 - .gitlab-ci/run-tests.sh || true
433 junit: "_build/${CI_JOB_NAME}-report.xml"
434 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
438 - "_build/glib/glibconfig.h"
439 - "_build/meson-logs"
440 - "_build/${CI_JOB_NAME}-report.xml"
443 extends: .only-default
446 needs: ['fedora-x86_64', 'msys2-mingw32']
448 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
452 - bash .gitlab-ci/show-execution-environment.sh
454 - bash -x ./.gitlab-ci/coverage-docker.sh
455 coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
458 extends: .build-only-schedules
463 - meson ${MESON_COMMON_OPTIONS}
465 --default-library=both
466 --prefix=$HOME/glib-installed
472 -Dinstalled_tests=true
474 - ninja -C _scan_build scan-build
476 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
479 - "_scan_build/meson-logs/scanbuild"
482 extends: .build-only-schedules
483 image: $COVERITY_IMAGE
487 # cov-build doesn’t like GLIB_DEPRECATED_ENUMERATOR
488 CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
490 - meson ${MESON_COMMON_OPTIONS}
492 --default-library=both
493 --prefix=$HOME/glib-installed
499 -Dinstalled_tests=true
501 - $HOME/cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C _coverity_build
502 - tar cfz cov-int.tar.gz cov-int
503 - curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
504 --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
505 --form file=@cov-int.tar.gz --form version="$CI_COMMIT_SHA"
506 --form description="$CI_COMMIT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
508 name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
511 - "cov-int/build-log.txt"
517 needs: ['coverage', 'style-check-diff']
519 - mv _coverage/ public/
530 # FIXME: Cannot use --fatal-meson-warnings here because meson warns about gtkdoc
531 # feature introduced in 0.52 but we only depends on 0.49.
532 - meson ${MESON_COMMON_OPTIONS_NO_WARNING} --buildtype release -Dgtk_doc=true -Dman=true _build
535 - ninja glib-doc gobject-doc gio-doc
536 - tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
537 - tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
538 - tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
541 - "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"
542 - "${CI_PROJECT_DIR}/_build/gobject-docs-$CI_COMMIT_TAG.tar.xz"
543 - "${CI_PROJECT_DIR}/_build/gio-docs-$CI_COMMIT_TAG.tar.xz"
544 - "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"