diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2023-01-04 15:17:16 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2023-01-05 10:32:01 +1000 |
commit | b2e12fe926d232210fdf488455f97c8b3f2f700e (patch) | |
tree | 4a763e557172a9e98f854b8d8e36b9affe46166d /.gitlab-ci.yml | |
parent | 50ac79078ed4ba364bc52014eb98e5c72219c2ab (diff) | |
download | libevdev-b2e12fe926d232210fdf488455f97c8b3f2f700e.tar.gz |
gitlab CI: use b2c instead of qemu
This is copied from libinput's CI but as one large change rather than
cherry-picking the process on how to get here. meson-build.sh is synched
with libinput's version - it is a more generic version anyway.
With this change we no longer require separate images for the qemu runs,
our default image is qemu-capable and can be run in qemu via
boot2container (b2c).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 115 |
1 files changed, 36 insertions, 79 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a71e474..b641ae3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -72,49 +72,49 @@ variables: .fedora:34: extends: .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: '34' .fedora:35: extends: .fdo.distribution-image@fedora variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: '35' .ubuntu:22.04: extends: .fdo.distribution-image@ubuntu variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: '22.04' .ubuntu:22.10: extends: .fdo.distribution-image@ubuntu variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: '22.10' .debian:stable: extends: .fdo.distribution-image@debian variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: 'stable' .debian:sid: extends: .fdo.distribution-image@debian variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: 'sid' .arch:rolling: extends: .fdo.distribution-image@arch variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: 'rolling' .alpine:latest: extends: .fdo.distribution-image@alpine variables: - FDO_DISTRIBUTION_TAG: '2023-01-04.5' + FDO_DISTRIBUTION_TAG: '2023-01-05.0' FDO_DISTRIBUTION_VERSION: 'latest' @@ -182,7 +182,7 @@ check-merge-request: .fedora.packages: variables: - FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer' + FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer systemd-udev qemu-img qemu-system-x86-core qemu-system-aarch64-core jq python3-click python3-rich' .ubuntu.packages: variables: @@ -201,36 +201,6 @@ check-merge-request: FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers' -# Pulls in the qemu container from upstream or rebuilds it if missing -.fedora:35@qemu-prep: - extends: - - .fedora:35 - - .fedora.packages - - .fdo.qemu-build@fedora - stage: prep - tags: - - kvm - variables: - GIT_STRATEGY: none - FDO_DISTRIBUTION_TAG: qemu-2023-01-04.5 - allow_failure: true - -# Always rebuilds the container -.fedora:35@qemu-forced-rebuild: - extends: - - .fedora:35@qemu-prep - variables: - FDO_FORCE_REBUILD: 1 - only: - - schedules - -# This is the actual job -fedora:35@qemu-prep: - extends: .fedora:35@qemu-prep - -fedora:35@qemu-forced-rebuild: - extends: .fedora:35@qemu-forced-rebuild - # Pulls in the container from upstream or rebuilds it if missing fedora:34@container-prep: @@ -748,59 +718,46 @@ soname: exit 1 ; fi -.qemu@fedora:35: +# build on the host, then run a systemd service to execute the test suite +# inside the qemu VM handled by b2c +.build-in-b2c@template: extends: - - .fedora:35 - stage: VM - image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG + - .default_artifacts tags: - kvm variables: MESON_BUILDDIR: build_dir + B2C_KERNEL: https://gitlab.freedesktop.org/api/v4/projects/libevdev%2Fhid-tools/packages/generic/kernel-x86_64/v5.19/bzImage + B2C_VERSION: v0.9.8 + B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE + B2C_COMMAND: .gitlab-ci/start-in-systemd.sh script: - # start our vm, no args required - - /app/vmctl start - - - *check_tainted - - - "scp -r $PWD vm:" - - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv - - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv - - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv - - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv - - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv - - "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment" - - /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true - # no matter the results of the tests, we want to fetch the logs - - scp -r vm:$CI_PROJECT_NAME/"$MESON_BUILDDIR" . - - - *check_tainted - - - /app/vmctl stop - - - if [[ ! -e .success ]] ; - then - exit 1 ; - fi - artifacts: - name: "qemu-meson-logs-$CI_JOB_NAME" - when: always - expire_in: 1 week - paths: - - $MESON_BUILDDIR/meson-logs - - console.out - reports: - junit: $MESON_BUILDDIR/junit-*.xml - needs: ['fedora:35@qemu-prep'] + # first build in the host container + - .gitlab-ci/meson-build.sh --skip-test + + # pull b2c + - curl -L -o /app/boot2container https://gitlab.freedesktop.org/mupuf/boot2container/-/raw/v0.9.8/vm2c.py + - chmod +x /app/boot2container + + # runs the test suite only + - /app/boot2container qemu:meson: - extends: .qemu@fedora:35 + stage: VM + extends: + - .fdo.distribution-image@fedora + - .fedora:35 + - .build-in-b2c@template + needs: + - "fedora:35@container-prep" qemu:meson:valgrind: - extends: .qemu@fedora:35 + extends: + - qemu:meson variables: MESON_TEST_ARGS: '--setup=valgrind' + meson-from-tarball: extends: - .fedora:35 |