geary/.gitlab-ci.yml
Niels De Graef b7bd689bd8 ci: Make use of pre-built container images
Rather than continuously calling `dnf upgrade` and `dnf install`, let's
make use of pre-built containers that we can auto-generate thanks to the
FDO CI templates.

This should cut down on the CI time considerably.

Note that this commit drops Ubuntu as a distribution for now. With
Fedora, we should be close enough to figure out if non-Flatpak builds
are broken, without doing packaging work for every distro out there.
2025-11-24 00:17:12 +01:00

147 lines
3.5 KiB
YAML

#
# Geary CI config.
#
include:
- project: Infrastructure/freedesktop-ci-templates
file: templates/fedora.yml
ref: aec7a6ce7bb38902c70641526f6611e27141784a
- project: 'GNOME/citemplates'
file: 'flatpak/flatpak_ci_initiative.yml'
# See https://gitlab.gnome.org/GNOME/geary/-/issues/1498
ref: 8430bccd6150b0a2aa97d1d7028c28b6b7e5d4d0
variables:
FDO_UPSTREAM_REPO: gnome/geary
# ImapDB and other tests that touch the disk are super slow on CI
# runners like gcc150.osuosl.org that use platter drives still.
# See Infrastructure/Infrastructure#97.
TEST_ARGS: -t 10
# Locale used for unit tests
TEST_LOCALE: C.UTF-8
stages:
- prepare
- build
- deploy
##
# Stage: Prepare
#
# This mostly consists of preparing Docker iamges for re-use the CI
##
# See also https://gitlab.gnome.org/Infrastructure/freedesktop-ci-templates
build.container.fedora@x86_64:
extends:
- '.fdo.container-build@fedora'
- '.fedora.container.common'
stage: 'prepare'
variables:
# no need to pull the whole tree for rebuilding the image
GIT_STRATEGY: none
# Expiry sets fdo.expires on the image
FDO_EXPIRES_AFTER: 8w
# Geary build dependencies (Fedora packages)
FDO_DISTRIBUTION_PACKAGES: >-
appstream
dbus-daemon
dconf
desktop-file-utils
enchant2-devel
folks-devel
gcr3-devel
git
glib-networking
glib2-devel
glibc-langpack-en
gmime30-devel
gnome-online-accounts-devel
gnutls-utils
gsettings-desktop-schemas
gsound-devel
gspell-devel
gtk3-devel
iso-codes-devel
itstool
json-glib-devel
libgee-devel
libhandy1-devel
libicu-devel
libpeas1-devel
libsecret-devel
libstemmer-devel
libunwind-devel
libxml2-devel
libytnef-devel
meson
ninja
pinentry-gnome3
sqlite-devel
vala
webkit2gtk4.1-devel
Xvfb
.fedora.container.common:
variables:
# When branching a stable release, change 'main' to the
# release branch name to ensure that a new image will
# be created, tailored for the stable branch.
BRANCH_NAME: 'main'
CONTAINER_TAG: '2025-11-23.0'
FEDORA_VERSION: latest
# Derive FDO variables from this automatically.
# DO NOT edit, instead change the variables above
FDO_REPO_SUFFIX: '${BRANCH_NAME}'
FDO_DISTRIBUTION_TAG: '${CONTAINER_TAG}-fedora-${FEDORA_VERSION}'
FDO_DISTRIBUTION_VERSION: '${FEDORA_VERSION}'
##
# Stage: Build
#
# This stage actually builds & tests Geary. It does so both in Fedora, and in Flatpak
##
fedora:
extends:
- '.fdo.suffixed-image@fedora'
- '.fedora.container.common'
stage: build
variables:
BUILD_DIR: _build
script:
- meson setup --buildtype=debug "$BUILD_DIR"
- meson compile -C "$BUILD_DIR"
- xvfb-run -a dbus-run-session -- meson test -v --no-stdsplit -C "$BUILD_DIR" "$TEST_ARGS"
- meson install -C "$BUILD_DIR"
artifacts:
when: 'always'
paths:
- '$BUILD_DIR/meson-logs'
expire_in: 2 days
flatpak:
stage: build
variables:
APP_ID: org.gnome.Geary.Devel
FLATPAK_MODULE: geary
MANIFEST_PATH: org.gnome.Geary.json
RUNTIME_REPO: 'https://nightly.gnome.org/gnome-nightly.flatpakrepo'
TEST_RUN_ARGS: $TEST_ARGS
BUNDLE: geary-dev.flatpak
extends: .flatpak
# This is broken, allow it to fail.
allow_failure: true
##
# Stage: Deploy
#
# This stage is meant for deplying any nightly (Flatpak) builds, docs, etc
##
nightly:
extends: '.publish_nightly'
needs: ['flatpak']