diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2020-11-02 10:56:22 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2020-11-06 14:56:17 +1000 |
commit | 05c141cb21197a9e06df20365a5d43fa6d915ae1 (patch) | |
tree | e6f2b359d7794d78096a86ed1fd9a7e1af3c5c07 /.gitlab-ci.yml | |
parent | 3d7a2f29f7e08e9e090c5687b9b8bf2d52dea6bb (diff) | |
download | xkeyboard-config-05c141cb21197a9e06df20365a5d43fa6d915ae1.tar.gz |
gitlab CI: switch to using CI templates
Generate an Arch container and run our builds off that. This gives us a few
advantages:
- the container image is always the same until twe change the tag, so we
can reproduce any build issues easily
- we don't need to pull from docker hub unless we rebuild the images, so we're
less affected by the upcoming ratelimits
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 57 |
1 files changed, 37 insertions, 20 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f591010..6be670c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,32 +1,56 @@ # vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0: +.templates_sha: &template_sha d303fafa66bbca44cc5bdb337d5773b5f019b70d # see https://docs.gitlab.com/ee/ci/yaml/#includefile + + +include: + # Arch container builder template + - project: 'freedesktop/ci-templates' + ref: *template_sha + file: '/templates/arch.yml' + + # global variables to be used by most/all jobs. variables: - # minimal set of packages required to build xkeyboard-config. extra packages - # will be installed in the tests where required. - ARCH_PKGS: 'xorg-util-macros autoconf automake make gettext pkg-config gcc grep m4 python meson ninja git' + FDO_UPSTREAM_REPO: 'xkeyboard-config/xkeyboard-config' + BUILDDIR: '_build' # installation directory must be inside $CI_PROJECT_DIR to allow for artifact caching INSTDIR: '$CI_PROJECT_DIR/_inst' # Override these in the jobs to pass commands to configure/make CONFIGURE_ARGS: '' MAKE_EXTRA_ARG: '' - FDO_UPSTREAM_REPO: 'xkeyboard-config/xkeyboard-config' + + # Changing the tag will rebuild the container images. The value is just a + # string, but we use the date for human benefits. + FDO_DISTRIBUTION_TAG: '2020-11-06.0' + stages: + - prep - build - dist - test - gitlab -# We use arch because the image updates frequently and we're not stuck -# forever in the update phase + +container-prep: + extends: + - .fdo.container-build@arch + stage: prep + variables: + GIT_STRATEGY: none + # minimal set of packages required to build xkeyboard-config. + BASE_PACKAGES: 'xorg-util-macros autoconf automake make gettext pkg-config gcc grep m4 python meson ninja git' + # extra packages we need for various tests + EXTRA_PACKAGES: 'tree libxml2 bison xorg-xkbcomp python-pytest' + FDO_DISTRIBUTION_PACKAGES: $BASE_PACKAGES $EXTRA_PACKAGES + + .default_setup: - image: archlinux/base - before_script: - - pacman -S --refresh - - pacman -S --sysupgrade --noconfirm - - pacman -S --noconfirm $ARCH_PKGS + extends: + - .fdo.distribution-image@arch + .default_build: extends: .default_setup @@ -78,7 +102,6 @@ make_install: variables: MAKE_EXTRA_COMMAND: "install" after_script: - - pacman -S --noconfirm tree - tree $INSTDIR artifacts: name: installed files @@ -110,7 +133,6 @@ meson_build: variables: NINJA_EXTRA_COMMAND: "install" after_script: - - pacman -S --noconfirm tree - tree $INSTDIR artifacts: name: installed files @@ -140,14 +162,11 @@ meson_from_tarball: GIT_STRATEGY: none xmllint: - image: archlinux/base + extends: + - .default_setup dependencies: ['make_install'] needs: ['make_install'] stage: test - before_script: - - pacman -S --refresh - - pacman -S --sysupgrade --noconfirm - - pacman -S --noconfirm libxml2 script: - xmllint --dtdvalid "$INSTDIR/share/X11/xkb/rules/xkb.dtd" $INSTDIR/share/X11/xkb/rules/*.xml > /dev/null @@ -160,7 +179,6 @@ layout_tests: stage: test needs: ["make_install"] script: - - pacman -S --noconfirm git meson bison gcc - git clone https://github.com/xkbcommon/libxkbcommon - pushd libxkbcommon > /dev/null - meson builddir -Denable-wayland=false -Denable-x11=false -Denable-docs=false -Dxkb-config-root="$INSTDIR/share/X11/xkb" @@ -181,7 +199,6 @@ keymap_tests: extends: .default_setup stage: test script: - - pacman -S --noconfirm xorg-xkbcomp python-pytest - export XKB_CONFIG_ROOT="$INSTDIR/share/X11/xkb" - pytest --junitxml=results.xml artifacts: |