glib2.0/.gitlab-ci.yml

702 lines
21 KiB
YAML
Raw Normal View History

2023-02-14 16:00:02 +08:00
stages:
- style-check
- build
- coverage
- analysis
- deploy
2024-02-29 14:32:35 +08:00
- report
2023-02-14 16:00:02 +08:00
cache:
paths:
- _ccache/
variables:
2024-02-29 14:32:35 +08:00
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v20"
2023-02-14 16:00:02 +08:00
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
2024-02-29 14:32:35 +08:00
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v14"
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v10"
MESON_TEST_TIMEOUT_MULTIPLIER: 4
2023-02-14 16:00:02 +08:00
G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
2024-02-29 14:32:35 +08:00
# Default CI job setup; contrast with `.only-origin`.
#
# Dont execute the pipeline when a merge request is merged into `main`, as it
# will have already been tested
2023-02-14 16:00:02 +08:00
.only-default:
only:
- branches
except:
2024-02-29 14:32:35 +08:00
refs:
- tags
variables:
- $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
2023-02-14 16:00:02 +08:00
# Some jobs run on CI runners which dont have good isolation between CI jobs,
# and dont have much available resource. Limit those jobs to only ones on the
# origin repository (GNOME/glib), rather than peoples 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 theyre executed on a weekly
# schedule in order to save CI resources and speed up branch pipelines.
.only-schedules:
only:
- schedules
except:
- tags
.build-linux:
before_script:
- bash .gitlab-ci/show-execution-environment.sh
- cp -r $HOME/subprojects/* subprojects/
2024-02-29 14:32:35 +08:00
# FIXME: Work around https://gitlab.com/gitlab-org/gitlab/-/issues/391756
.only-default-with-git:
2023-02-14 16:00:02 +08:00
extends: .only-default
2024-02-29 14:32:35 +08:00
before_script:
- rm -rf subprojects/gvdb
- git submodule update --init --depth 1
variables:
GIT_SUBMODULE_STRATEGY: "none"
GIT_SUBMODULE_DEPTH: 1
style-check-advisory:
extends: .only-default-with-git
2023-02-14 16:00:02 +08:00
image: $DEBIAN_IMAGE
stage: style-check
allow_failure: true
script:
- .gitlab-ci/run-style-check-diff.sh
2024-02-29 14:32:35 +08:00
- .gitlab-ci/run-check-todos.sh
sh-and-py-check:
extends: .only-default
image: $DEBIAN_IMAGE
stage: style-check
allow_failure: false
script:
2023-02-14 16:00:02 +08:00
- .gitlab-ci/run-shellcheck.sh
- .gitlab-ci/run-black.sh
- .gitlab-ci/run-flake8.sh
2024-02-29 14:32:35 +08:00
only:
changes:
- "**/*.py"
- "**/*.sh"
style-check-mandatory:
extends: .only-default-with-git
image: $DEBIAN_IMAGE
stage: style-check
allow_failure: false
script:
- .gitlab-ci/run-reuse.sh
2023-02-14 16:00:02 +08:00
fedora-x86_64:
extends:
- .build-linux
- .only-default
image: $FEDORA_IMAGE
stage: build
needs: []
variables:
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
script:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Dgtk_doc=true
_build
2024-02-29 14:32:35 +08:00
- meson compile -C _build
2023-02-14 16:00:02 +08:00
- 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"
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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/docs/reference/glib/glib-undeclared.txt"
- "_build/docs/reference/glib/glib-undocumented.txt"
- "_build/docs/reference/glib/glib-unused.txt"
- "_build/docs/reference/gobject/gobject-undeclared.txt"
- "_build/docs/reference/gobject/gobject-undocumented.txt"
- "_build/docs/reference/gobject/gobject-unused.txt"
- "_build/docs/reference/gio/gio-undeclared.txt"
- "_build/docs/reference/gio/gio-undocumented.txt"
- "_build/docs/reference/gio/gio-unused.txt"
- "_coverage"
debian-stable-x86_64:
extends:
- .build-linux
- .only-default
image: $DEBIAN_IMAGE
stage: build
needs: []
script:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
_build
2024-02-29 14:32:35 +08:00
- meson compile -C _build
2023-02-14 16:00:02 +08:00
- .gitlab-ci/run-tests.sh
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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
image: $FEDORA_IMAGE
stage: build
needs: []
script:
# dtrace is disabled because it breaks the static-link.py test
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
--prefix=/usr --libdir=/usr/lib64
-Dinstalled_tests=true
-Ddefault_library=both
-Ddtrace=false
_build
2024-02-29 14:32:35 +08:00
- meson compile -C _build
- sudo meson install -C _build
2023-02-14 16:00:02 +08:00
# 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
image: $FEDORA_IMAGE
stage: build
needs: []
script:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
-Dglib_assert=false
_build
2024-02-29 14:32:35 +08:00
- meson compile -C _build
2023-02-14 16:00:02 +08:00
- bash -x ./.gitlab-ci/run-tests.sh
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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
image: $FEDORA_IMAGE
stage: analysis
needs: []
variables:
MESON_TEST_TIMEOUT_MULTIPLIER: 15
script:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
_build
2024-02-29 14:32:35 +08:00
- meson compile -C _build
2023-02-14 16:00:02 +08:00
# Valgrind doesnt 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
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS} --cross-file=.gitlab-ci/cross_file_android_arm64_31.txt _build
- meson compile -C _build
2023-02-14 16:00:02 +08:00
cross-mingw64:
extends:
- .cross-build-linux
- .only-default
image: $MINGW_IMAGE
2024-02-29 14:32:35 +08:00
variables:
PYTHONUTF8: "1"
2023-02-14 16:00:02 +08:00
script:
# FIXME: Add --werror
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
- meson compile -C _build
2023-02-14 16:00:02 +08:00
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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
stage: build
tags:
- win32-ps
needs: []
variables:
MSYSTEM: "MINGW32"
CHERE_INVOKING: "yes"
2024-02-29 14:32:35 +08:00
CFLAGS: -coverage -ftest-coverage -fprofile-arcs
PYTHONUTF8: "1"
# FIXME: For some reason enabling jit debugging "fixes" random python crashes
# see https://github.com/msys2/MINGW-packages/issues/11864 and
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3280#note_1678973
MSYS: "winjitdebug"
2023-02-14 16:00:02 +08:00
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:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
- _coverage/
2024-02-29 14:32:35 +08:00
msys2-clang64:
extends: .only-schedules
stage: build
tags:
- win32-ps
needs: []
variables:
MSYSTEM: "CLANG64"
CHERE_INVOKING: "yes"
PYTHONUTF8: "1"
# FIXME: For some reason enabling jit debugging "fixes" random python crashes
# see https://github.com/msys2/MINGW-packages/issues/11864 and
# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3280#note_1678973
MSYS: "winjitdebug"
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
2023-02-14 16:00:02 +08:00
vs2017-x64:
extends: .only-default
stage: build
tags:
- win32-ps
needs: []
2024-02-29 14:32:35 +08:00
variables:
PYTHONUTF8: "1"
2023-02-14 16:00:02 +08:00
script:
# FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
# arent 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:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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: []
2024-02-29 14:32:35 +08:00
variables:
PYTHONUTF8: "1"
2023-02-14 16:00:02 +08:00
script:
# FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
# arent 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:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
when: always
expire_in: 1 week
paths:
- _build/meson-logs
freebsd-12-x86_64:
# The FreeBSD 13 build is run on each commit, so the FreeBSD 12 build can be
# run less regularly to save CI resources. The chance of a regression on
# FreeBSD 12 and not FreeBSD 13 is tiny.
extends: .only-schedules
stage: build
tags:
# To run a FreeBSD builder, install gitlab-runner package and start both
# gitlab-runner and dbus service because we need /var/lib/dbus/machine-id.
# To compile GLib, you still have to install the following packages:
# desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info
- freebsd-12
needs: []
variables:
# CPPFLAGS is required because libintl doesn't use pkg-config.
CPPFLAGS: -I/usr/local/include
# FIXME: Workaround meson inability to set LD_LIBRARY_PATH.
# https://github.com/mesonbuild/meson/issues/1383
# https://github.com/mesonbuild/meson/issues/1635
# https://github.com/mesonbuild/meson/issues/2881
LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
# FreeBSD supports C.UTF-8 locale since 12.1.
LANG: C.UTF-8
before_script:
- bash .gitlab-ci/show-execution-environment.sh
script:
# We cannot use -Wl,--no-undefined because GLib uses 'environ' variable.
# FreeBSD supports xattr, but its API is different from Linux xattr.
# FIXME: extattr(2) support: https://gitlab.gnome.org/GNOME/glib/issues/1404
# localstatedir is needed for access to /var/lib/dbus/machine-id
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Dxattr=false _build
- meson compile -C _build
2023-02-14 16:00:02 +08:00
- bash -x ./.gitlab-ci/run-tests.sh
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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"
freebsd-13-x86_64:
extends: .only-origin
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:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Dxattr=false _build
- meson compile -C _build
2023-02-14 16:00:02 +08:00
- bash -x ./.gitlab-ci/run-tests.sh
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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"
2024-02-29 14:32:35 +08:00
macos-x86_64:
2023-02-14 16:00:02 +08:00
extends: .only-origin
stage: build
tags:
2024-02-29 14:32:35 +08:00
- macosintel
2023-02-14 16:00:02 +08:00
needs: []
2024-02-29 14:32:35 +08:00
cache: []
2023-02-14 16:00:02 +08:00
variables:
GIT_SUBMODULE_STRATEGY: normal
2024-02-29 14:32:35 +08:00
# -Wno-overlength-strings
2023-02-14 16:00:02 +08:00
# 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
2024-02-29 14:32:35 +08:00
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
2023-02-14 16:00:02 +08:00
before_script:
- bash .gitlab-ci/show-execution-environment.sh
2024-02-29 14:32:35 +08:00
- 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.0
- pip3 install ninja==1.11.1
2023-02-14 16:00:02 +08:00
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
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--wrap-mode=default
--werror
_build
2024-02-29 14:32:35 +08:00
- meson compile -C _build
2023-02-14 16:00:02 +08:00
- .gitlab-ci/run-tests.sh
artifacts:
reports:
2024-02-29 14:32:35 +08:00
junit:
- _build/meson-logs/testlog.junit.xml
- _build/meson-logs/testlog-*.junit.xml
2023-02-14 16:00:02 +08:00
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
image: $FEDORA_IMAGE
stage: analysis
needs: []
script:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
_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"
2024-02-29 14:32:35 +08:00
.coverity:
2023-02-14 16:00:02 +08:00
extends:
- .build-linux
- .only-schedules
image: $COVERITY_IMAGE
stage: analysis
needs: []
variables:
# cov-build doesnt like GLIB_DEPRECATED_ENUMERATOR
CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
script:
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS}
2023-02-14 16:00:02 +08:00
--werror
--default-library=both
--prefix=$HOME/glib-installed
--localstatedir=/var
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dinstalled_tests=true
_coverity_build
2024-02-29 14:32:35 +08:00
- $HOME/cov-analysis-linux64-*/bin/cov-build --dir cov-int meson compile -C _coverity_build
2023-02-14 16:00:02 +08:00
- 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:
2024-02-29 14:32:35 +08:00
extends: .only-schedules
2023-02-14 16:00:02 +08:00
stage: deploy
2024-02-29 14:32:35 +08:00
needs: ['coverage', 'style-check-advisory']
2023-02-14 16:00:02 +08:00
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
2024-02-29 14:32:35 +08:00
- meson setup ${MESON_COMMON_OPTIONS} --buildtype release -Dgtk_doc=true -Dman=true _build
- meson dist -C _build
- ninja -C _build glib-doc gobject-doc gio-doc
2023-02-14 16:00:02 +08:00
- tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
- tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
- tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
artifacts:
paths:
- "${CI_PROJECT_DIR}/_build/glib-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/meson-dist/glib-*.tar.xz"
2024-02-29 14:32:35 +08:00
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