.templates_sha: &template_sha e195d80f35b45cc73668be3767b923fd76c70ed5
include:
- project: 'freedesktop/ci-templates'
ref: *template_sha
file:
- '/templates/alpine.yml'
- '/templates/arch.yml'
- '/templates/debian.yml'
- '/templates/fedora.yml'
- '/templates/ubuntu.yml'
- '/templates/ci-fairy.yml'
stages:
- prep - build - VM - autotools - meson - tarballs - container_clean - merge-check
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
variables:
FDO_UPSTREAM_REPO: libevdev/libevdev
GIT_DEPTH: 1
MESON_BUILDDIR: 'build dir'
.default_artifacts:
artifacts:
paths:
- _build/test/test-suite.log
- $MESON_BUILDDIR/meson-logs/
expire_in: 1 week
when: always
reports:
junit: $MESON_BUILDDIR/*junit*.xml
.autotools_build:
extends:
- .default_artifacts
script:
- mkdir _build
- pushd _build > /dev/null
- ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
- make
- make check
- if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
- popd > /dev/null
variables:
LIBEVDEV_SKIP_ROOT_TESTS: 1
.meson_build:
extends:
- .default_artifacts
script:
- .gitlab-ci/meson-build.sh --run-test
variables:
MESON_TEST_ARGS: '--no-suite=needs-uinput'
.fedora:40:
extends: .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '40'
.fedora:41:
extends: .fdo.distribution-image@fedora
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '41'
.ubuntu:24.10:
extends: .fdo.distribution-image@ubuntu
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: '24.10'
.debian:stable:
extends: .fdo.distribution-image@debian
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'stable'
.debian:sid:
extends: .fdo.distribution-image@debian
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'sid'
.arch:rolling:
extends: .fdo.distribution-image@arch
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'rolling'
.alpine:latest:
extends: .fdo.distribution-image@alpine
variables:
FDO_DISTRIBUTION_TAG: '2024-11-25.0'
FDO_DISTRIBUTION_VERSION: 'latest'
check-ci-script:
extends:
- .fdo.ci-fairy
stage: prep
script:
- ci-fairy generate-template --verify && exit 0 || true
- echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
- exit 1
check-commit:
extends:
- .fdo.ci-fairy
stage: prep
script:
- ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
- echo "Error checking the commit message format. Please verify"
- exit 1
except:
- master@libevdev/libevdev
variables:
GIT_DEPTH: 100
artifacts:
reports:
junit: results.xml
check-merge-request:
extends:
- .fdo.ci-fairy
stage: merge-check
script:
- ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
artifacts:
when: on_failure
reports:
junit: results.xml
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
.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 systemd-udev qemu-img qemu-system-x86-core qemu-system-aarch64-core jq python3-click python3-rich'
.ubuntu.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
.debian.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
.arch.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
.alpine.packages:
variables:
FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
fedora:40@container-prep:
extends:
- .fedora:40
- .fedora.packages
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
fedora:41@container-prep:
extends:
- .fedora:41
- .fedora.packages
- .fdo.container-build@fedora
stage: prep
variables:
GIT_STRATEGY: none
ubuntu:24.10@container-prep:
extends:
- .ubuntu:24.10
- .ubuntu.packages
- .fdo.container-build@ubuntu
stage: prep
variables:
GIT_STRATEGY: none
debian:stable@container-prep:
extends:
- .debian:stable
- .debian.packages
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
debian:sid@container-prep:
extends:
- .debian:sid
- .debian.packages
- .fdo.container-build@debian
stage: prep
variables:
GIT_STRATEGY: none
arch:rolling@container-prep:
extends:
- .arch:rolling
- .arch.packages
- .fdo.container-build@arch
stage: prep
variables:
GIT_STRATEGY: none
alpine:latest@container-prep:
extends:
- .alpine:latest
- .alpine.packages
- .fdo.container-build@alpine
stage: prep
variables:
GIT_STRATEGY: none
.container-clean:
extends:
- .fdo.ci-fairy
stage: container_clean
script:
- ci-fairy -v --authfile $AUTHFILE delete-image
--repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
--exclude-tag $FDO_DISTRIBUTION_TAG
dependencies: []
allow_failure: true
only:
- schedules
fedora:40@container-clean:
extends:
- .fedora:40
- .container-clean
needs: ["fedora:40@container-prep"]
fedora:41@container-clean:
extends:
- .fedora:41
- .container-clean
needs: ["fedora:41@container-prep"]
ubuntu:24.10@container-clean:
extends:
- .ubuntu:24.10
- .container-clean
needs: ["ubuntu:24.10@container-prep"]
debian:stable@container-clean:
extends:
- .debian:stable
- .container-clean
needs: ["debian:stable@container-prep"]
debian:sid@container-clean:
extends:
- .debian:sid
- .container-clean
needs: ["debian:sid@container-prep"]
arch:rolling@container-clean:
extends:
- .arch:rolling
- .container-clean
needs: ["arch:rolling@container-prep"]
alpine:latest@container-clean:
extends:
- .alpine:latest
- .container-clean
needs: ["alpine:latest@container-prep"]
.autotools-build@template:
extends:
- .autotools_build
stage: build
dependencies: []
variables:
MAKE_ARGS: "distcheck"
.meson-build@template:
extends:
- .meson_build
stage: build
dependencies: []
fedora:40@autotools-build:
extends:
- .fedora:40
- .autotools-build@template
stage: autotools
needs: ['fedora:40@container-prep']
fedora:40@meson-build:
extends:
- .fedora:40
- .meson-build@template
stage: meson
needs: ['fedora:40@container-prep']
fedora:41@autotools-build:
extends:
- .fedora:41
- .autotools-build@template
stage: autotools
needs: ['fedora:41@container-prep']
fedora:41@meson-build:
extends:
- .fedora:41
- .meson-build@template
stage: meson
needs: ['fedora:41@container-prep']
ubuntu:24.10@autotools-build:
extends:
- .ubuntu:24.10
- .autotools-build@template
stage: autotools
needs: ['ubuntu:24.10@container-prep']
ubuntu:24.10@meson-build:
extends:
- .ubuntu:24.10
- .meson-build@template
stage: meson
needs: ['ubuntu:24.10@container-prep']
debian:stable@autotools-build:
extends:
- .debian:stable
- .autotools-build@template
stage: autotools
needs: ['debian:stable@container-prep']
debian:stable@meson-build:
extends:
- .debian:stable
- .meson-build@template
stage: meson
needs: ['debian:stable@container-prep']
debian:sid@autotools-build:
extends:
- .debian:sid
- .autotools-build@template
stage: autotools
needs: ['debian:sid@container-prep']
debian:sid@meson-build:
extends:
- .debian:sid
- .meson-build@template
stage: meson
needs: ['debian:sid@container-prep']
arch:rolling@autotools-build:
extends:
- .arch:rolling
- .autotools-build@template
stage: autotools
needs: ['arch:rolling@container-prep']
arch:rolling@meson-build:
extends:
- .arch:rolling
- .meson-build@template
stage: meson
needs: ['arch:rolling@container-prep']
alpine:latest@autotools-build:
extends:
- .alpine:latest
- .autotools-build@template
stage: autotools
needs: ['alpine:latest@container-prep']
alpine:latest@meson-build:
extends:
- .alpine:latest
- .meson-build@template
stage: meson
needs: ['alpine:latest@container-prep']
.fedora-custom-build@autotools-template:
extends:
- .fedora:40
- .autotools-build@template
stage: build
needs: ['fedora:40@container-prep']
no-valgrind:autotools:
extends: .fedora-custom-build@autotools-template
before_script:
- dnf remove -y valgrind
no-check:autotools:
extends: .fedora-custom-build@autotools-template
before_script:
- dnf remove -y check check-devel
no-doxygen:autotools:
extends: .fedora-custom-build@autotools-template
before_script:
- dnf remove -y doxygen
variables:
MAKE_ARGS: ''
no-doxygen-check-valgrind:autotools:
extends: .fedora-custom-build@autotools-template
before_script:
- dnf remove -y doxygen valgrind check check-devel
variables:
MAKE_ARGS: ''
no-nm:autotools:
extends: .fedora-custom-build@autotools-template
before_script:
- mv /usr/bin/nm /usr/bin/nm.moved
enable-gcov:autotools:
extends: .fedora-custom-build@autotools-template
variables:
CONFIGURE_FLAGS: "--enable-gcov"
.fedora-custom-build@meson-template:
extends:
- .fedora:40
- .meson-build@template
stage: build
needs: ['fedora:40@container-prep']
no-valgrind:meson:
extends: .fedora-custom-build@meson-template
before_script:
- dnf remove -y valgrind
no-check:meson:
extends: .fedora-custom-build@meson-template
before_script:
- dnf remove -y check check-devel
variables:
MESON_ARGS: -Dtests=disabled
no-doxygen:meson:
extends: .fedora-custom-build@meson-template
before_script:
- dnf remove -y doxygen
variables:
MESON_ARGS: -Ddocumentation=disabled
NINJA_ARGS: ''
no-doxygen-check-valgrind:meson:
extends: .fedora-custom-build@meson-template
before_script:
- dnf remove -y doxygen valgrind check check-devel
variables:
MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
NINJA_ARGS: ''
enable-gcov:meson:
extends: .fedora-custom-build@meson-template
variables:
MESON_ARGS: '-Dcoverity=true'
scan-build:meson:
extends: .fedora-custom-build@meson-template
variables:
NINJA_ARGS: 'scan-build'
static-build:meson:
extends: .fedora-custom-build@meson-template
script:
- meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
- ninja -C "$MESON_BUILDDIR" install
- ls -l $PWD/prefix-meson/lib64/libevdev.a
soname:
extends:
- .fedora:40
stage: build
script:
- ./autogen.sh --prefix=$PWD/prefix-autotools/
- make install
- ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
- meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
- ninja -C "$MESON_BUILDDIR" install
- ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
needs: ['fedora:40@container-prep']
.check_tainted: &check_tainted |
# make sure the kernel is not tainted
if [[ "$(/app/vmctl exec cat /proc/sys/kernel/tainted)" -gt 0 ]];
then
echo tainted kernel ;
exit 1 ;
fi
.build-in-b2c@template:
extends:
- .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/v6.5/bzImage
B2C_IMAGE: $FDO_DISTRIBUTION_IMAGE
B2C_COMMAND: .gitlab-ci/start-in-systemd.sh
script:
- .gitlab-ci/meson-build.sh --skip-test
- curl -L -o /app/boot2container https://gitlab.freedesktop.org/gfx-ci/boot2container/-/raw/2ff65156ba67fa8a0c309a4fc16c5df1a88a3844/vm2c.py
- chmod +x /app/boot2container
- /app/boot2container
qemu:meson:
stage: VM
extends:
- .fdo.distribution-image@fedora
- .fedora:41
- .build-in-b2c@template
needs:
- "fedora:41@container-prep"
qemu:meson:valgrind:
extends:
- qemu:meson
variables:
MESON_TEST_ARGS: '--setup=valgrind'
meson-from-tarball:
extends:
- .fedora:41
stage: tarballs
script:
- export INSTALLDIR="$PWD/_inst"
- mkdir _build
- pushd _build > /dev/null
- ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
- make
- make dist
- popd > /dev/null
- mkdir -p _tarball_dir
- tar xf _build/libevdev-*.tar.xz -C _tarball_dir
- pushd _tarball_dir/libevdev-*/ > /dev/null
- meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
- meson test -C "$MESON_BUILDDIR" --no-suite="needs-uinput"
- ninja -C "$MESON_BUILDDIR" install
- popd > /dev/null
- ls -lR $INSTALLDIR
needs: ['fedora:41@container-prep']
autotools-from-tarball:
extends:
- .fedora:41
stage: tarballs
script:
- export INSTALLDIR="$PWD/_inst"
- meson "$MESON_BUILDDIR"
- meson dist -C "$MESON_BUILDDIR" --no-tests
- mkdir -p _tarball_dir
- tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
- pushd _tarball_dir/libevdev-*/ > /dev/null
- mkdir _build
- pushd _build > /dev/null
- ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
- make
- make install
- make distcheck
- popd > /dev/null
- popd > /dev/null
- ls -lR $INSTALLDIR
variables:
LIBEVDEV_SKIP_ROOT_TESTS: 1
needs: ['fedora:41@container-prep']