1 ########################################
3 # THIS FILE IS GENERATED, DO NOT EDIT #
5 ########################################
7 .templates_sha: &template_sha d32ac1f30faad4fdef24af8a7724fb8c084c3dda # see https://docs.gitlab.com/ee/ci/yaml/#includefile
10 # Alpine container builder template
11 - project: 'freedesktop/ci-templates'
13 file: '/templates/alpine.yml'
14 # Arch container builder template
15 - project: 'freedesktop/ci-templates'
17 file: '/templates/arch.yml'
18 # Centos container builder template
19 - project: 'freedesktop/ci-templates'
21 file: '/templates/centos.yml'
22 # Debian container builder template
23 - project: 'freedesktop/ci-templates'
25 file: '/templates/debian.yml'
26 # Fedora container builder template
27 - project: 'freedesktop/ci-templates'
29 file: '/templates/fedora.yml'
30 # Ubuntu container builder template
31 - project: 'freedesktop/ci-templates'
33 file: '/templates/ubuntu.yml'
36 - prep # rebuild the container images if there is a change
37 - build # for actually building and testing things in a container
38 - VM # for running the test suite in a VM
39 - autotools # distribution builds with autotools
40 - meson # distribution builds with meson
41 - tarballs # tarball builds
42 - container_clean # clean up unused container images
45 # The upstrem repository we will check for images
46 FDO_UPSTREAM_REPO: libevdev/libevdev
47 LIBEVDEV_SKIP_ROOT_TESTS: 1
49 MESON_BUILDDIR: 'build dir'
54 - _build/test/test-suite.log
55 - $MESON_BUILDDIR/meson-logs/
59 junit: $MESON_BUILDDIR/junit-*.xml
66 - pushd _build > /dev/null
67 - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
70 - if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
77 - .gitlab-ci/meson-build.sh
80 extends: .fdo.distribution-image@fedora
82 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
83 FDO_DISTRIBUTION_VERSION: '30'
86 extends: .fdo.distribution-image@fedora
88 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
89 FDO_DISTRIBUTION_VERSION: '31'
92 extends: .fdo.distribution-image@ubuntu
94 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
95 FDO_DISTRIBUTION_VERSION: '19.10'
98 extends: .fdo.distribution-image@ubuntu
100 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
101 FDO_DISTRIBUTION_VERSION: '19.04'
104 extends: .fdo.distribution-image@debian
106 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
107 FDO_DISTRIBUTION_VERSION: 'stable'
110 extends: .fdo.distribution-image@debian
112 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
113 FDO_DISTRIBUTION_VERSION: 'sid'
116 extends: .fdo.distribution-image@centos
118 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
119 FDO_DISTRIBUTION_VERSION: '7'
122 extends: .fdo.distribution-image@centos
124 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
125 FDO_DISTRIBUTION_VERSION: '8'
128 extends: .fdo.distribution-image@arch
130 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
131 FDO_DISTRIBUTION_VERSION: 'rolling'
134 extends: .fdo.distribution-image@alpine
136 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
137 FDO_DISTRIBUTION_VERSION: 'latest'
141 #################################################################
145 #################################################################
147 # Re-generate the CI script and make sure it's the one currently checked in
148 # If this job fails, re-generate the gitlab-ci.yml script, see
149 # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
155 - apk add python3 git
156 - pip3 install --user jinja2 PyYAML
158 - python3 ./.gitlab-ci/generate-gitlab-ci.py
159 - git diff --exit-code && exit 0 || true
160 - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
167 - apk add python3 git
169 - pip3 install GitPython
170 - pip3 install pytest
172 pytest --junitxml=results.xml \
175 ./.gitlab-ci/check-commit.py
177 - master@libevdev/libevdev
190 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
194 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
198 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
202 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
206 FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
210 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
213 # Pulls in the qemu container from upstream or rebuilds it if missing
214 .fedora:30@qemu-prep:
218 - .fdo.qemu-build@fedora
224 FDO_DISTRIBUTION_TAG: qemu-2020-03-17.0
227 # Always rebuilds the container
228 .fedora:30@qemu-forced-rebuild:
230 - .fedora:30@qemu-prep
236 # Pulls in the qemu container from upstream or rebuilds it if missing
237 .fedora:31@qemu-prep:
241 - .fdo.qemu-build@fedora
247 FDO_DISTRIBUTION_TAG: qemu-2020-03-17.0
250 # Always rebuilds the container
251 .fedora:31@qemu-forced-rebuild:
253 - .fedora:31@qemu-prep
260 # This is the actual job
262 extends: .fedora:31@qemu-prep
264 fedora:31@qemu-forced-rebuild:
265 extends: .fedora:31@qemu-forced-rebuild
268 # Pulls in the container from upstream or rebuilds it if missing
269 fedora:30@container-prep:
273 - .fdo.container-build@fedora
278 # Always rebuilds the container
279 fedora:30@container-forced-rebuild:
281 - fedora:30@container-prep
288 # Pulls in the container from upstream or rebuilds it if missing
289 fedora:31@container-prep:
293 - .fdo.container-build@fedora
298 # Always rebuilds the container
299 fedora:31@container-forced-rebuild:
301 - fedora:31@container-prep
308 # Pulls in the container from upstream or rebuilds it if missing
309 ubuntu:19.10@container-prep:
313 - .fdo.container-build@ubuntu
318 # Always rebuilds the container
319 ubuntu:19.10@container-forced-rebuild:
321 - ubuntu:19.10@container-prep
328 # Pulls in the container from upstream or rebuilds it if missing
329 ubuntu:19.04@container-prep:
333 - .fdo.container-build@ubuntu
338 # Always rebuilds the container
339 ubuntu:19.04@container-forced-rebuild:
341 - ubuntu:19.04@container-prep
348 # Pulls in the container from upstream or rebuilds it if missing
349 debian:stable@container-prep:
353 - .fdo.container-build@debian
358 # Always rebuilds the container
359 debian:stable@container-forced-rebuild:
361 - debian:stable@container-prep
368 # Pulls in the container from upstream or rebuilds it if missing
369 debian:sid@container-prep:
373 - .fdo.container-build@debian
378 # Always rebuilds the container
379 debian:sid@container-forced-rebuild:
381 - debian:sid@container-prep
388 # Pulls in the container from upstream or rebuilds it if missing
389 centos:7@container-prep:
393 - .fdo.container-build@centos
398 # Always rebuilds the container
399 centos:7@container-forced-rebuild:
401 - centos:7@container-prep
408 # Pulls in the container from upstream or rebuilds it if missing
409 centos:8@container-prep:
413 - .fdo.container-build@centos
418 # Always rebuilds the container
419 centos:8@container-forced-rebuild:
421 - centos:8@container-prep
428 # Pulls in the container from upstream or rebuilds it if missing
429 arch:rolling@container-prep:
433 - .fdo.container-build@arch
438 # Always rebuilds the container
439 arch:rolling@container-forced-rebuild:
441 - arch:rolling@container-prep
448 # Pulls in the container from upstream or rebuilds it if missing
449 alpine:latest@container-prep:
453 - .fdo.container-build@alpine
458 # Always rebuilds the container
459 alpine:latest@container-forced-rebuild:
461 - alpine:latest@container-prep
468 #################################################################
470 # container clean stage #
471 # run during the clean stage #
473 #################################################################
476 # This stage will look for the container images we currently have in
477 # the registry and will remove any that are not tagged with the provided
478 # $container_image:$tag
480 stage: container_clean
484 - pip3 install --user python-gitlab
486 - LATEST_TAG=$(echo $DISTRO_CONTAINER_IMAGE | cut -f2 -d:)
487 # Go to your Profile, Settings, Access Tokens
488 # Create a personal token with 'api' scope, copy the value.
489 # Go to Settings, CI/CD, Variables
490 # Define a variable of type File named AUTHFILE. Content is that token
492 - python3 .gitlab-ci/gitlab-container-delete $CI_SERVER_URL $CI_PROJECT_PATH
493 --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
494 --authfile $AUTHFILE --exclude-tag "$LATEST_TAG"
501 fedora:30@container-clean:
505 needs: ["fedora:30@container-prep"]
508 fedora:31@container-clean:
512 needs: ["fedora:31@container-prep"]
515 ubuntu:19.10@container-clean:
519 needs: ["ubuntu:19.10@container-prep"]
522 ubuntu:19.04@container-clean:
526 needs: ["ubuntu:19.04@container-prep"]
529 debian:stable@container-clean:
533 needs: ["debian:stable@container-prep"]
536 debian:sid@container-clean:
540 needs: ["debian:sid@container-prep"]
543 centos:7@container-clean:
547 needs: ["centos:7@container-prep"]
550 centos:8@container-clean:
554 needs: ["centos:8@container-prep"]
557 arch:rolling@container-clean:
561 needs: ["arch:rolling@container-prep"]
564 alpine:latest@container-clean:
568 needs: ["alpine:latest@container-prep"]
571 #################################################################
575 #################################################################
577 .autotools-build@template:
583 MAKE_ARGS: "distcheck"
585 .meson-build@template:
594 fedora:30@autotools-build:
597 - .autotools-build@template
599 needs: ['fedora:30@container-prep']
601 fedora:30@meson-build:
604 - .meson-build@template
606 needs: ['fedora:30@container-prep']
609 fedora:31@autotools-build:
612 - .autotools-build@template
614 needs: ['fedora:31@container-prep']
616 fedora:31@meson-build:
619 - .meson-build@template
621 needs: ['fedora:31@container-prep']
624 ubuntu:19.10@autotools-build:
627 - .autotools-build@template
629 needs: ['ubuntu:19.10@container-prep']
631 ubuntu:19.10@meson-build:
634 - .meson-build@template
636 needs: ['ubuntu:19.10@container-prep']
639 ubuntu:19.04@autotools-build:
642 - .autotools-build@template
644 needs: ['ubuntu:19.04@container-prep']
646 ubuntu:19.04@meson-build:
649 - .meson-build@template
651 needs: ['ubuntu:19.04@container-prep']
654 debian:stable@autotools-build:
657 - .autotools-build@template
659 needs: ['debian:stable@container-prep']
661 debian:stable@meson-build:
664 - .meson-build@template
666 needs: ['debian:stable@container-prep']
669 debian:sid@autotools-build:
672 - .autotools-build@template
674 needs: ['debian:sid@container-prep']
676 debian:sid@meson-build:
679 - .meson-build@template
681 needs: ['debian:sid@container-prep']
684 centos:7@autotools-build:
687 - .autotools-build@template
690 MAKE_ARGS: '' # disable distcheck, requires doxygen
691 needs: ['centos:7@container-prep']
695 centos:8@autotools-build:
698 - .autotools-build@template
701 MAKE_ARGS: '' # disable distcheck, requires doxygen
702 needs: ['centos:8@container-prep']
706 arch:rolling@autotools-build:
709 - .autotools-build@template
711 needs: ['arch:rolling@container-prep']
713 arch:rolling@meson-build:
716 - .meson-build@template
718 needs: ['arch:rolling@container-prep']
721 alpine:latest@autotools-build:
724 - .autotools-build@template
726 needs: ['alpine:latest@container-prep']
728 alpine:latest@meson-build:
731 - .meson-build@template
733 needs: ['alpine:latest@container-prep']
736 # Build argument tests
738 # We only run the build option combinations on one image
739 # because they're supposed to fail equally on all
740 .fedora-custom-build@autotools-template:
743 - .autotools-build@template
745 needs: ['fedora:31@container-prep']
747 no-valgrind:autotools:
748 extends: .fedora-custom-build@autotools-template
750 - dnf remove -y valgrind
753 extends: .fedora-custom-build@autotools-template
755 - dnf remove -y check check-devel
757 no-doxygen:autotools:
758 extends: .fedora-custom-build@autotools-template
760 - dnf remove -y doxygen
762 MAKE_ARGS: '' # disable distcheck, requires doxygen
764 # doxygen is required for distcheck
765 no-doxygen-check-valgrind:autotools:
766 extends: .fedora-custom-build@autotools-template
768 - dnf remove -y doxygen valgrind check check-devel
770 MAKE_ARGS: '' # disable distcheck, requires doxygen
773 extends: .fedora-custom-build@autotools-template
775 - mv /usr/bin/nm /usr/bin/nm.moved
777 enable-gcov:autotools:
778 extends: .fedora-custom-build@autotools-template
780 CONFIGURE_FLAGS: "--enable-gcov"
782 .fedora-custom-build@meson-template:
785 - .meson-build@template
787 needs: ['fedora:31@container-prep']
790 extends: .fedora-custom-build@meson-template
792 - dnf remove -y valgrind
795 extends: .fedora-custom-build@meson-template
797 - dnf remove -y check check-devel
799 MESON_ARGS: -Dtests=disabled
802 # doxygen is required for dist
804 extends: .fedora-custom-build@meson-template
806 - dnf remove -y doxygen
808 MESON_ARGS: -Ddocumentation=disabled
811 # doxygen is required for dist
812 no-doxygen-check-valgrind:meson:
813 extends: .fedora-custom-build@meson-template
815 - dnf remove -y doxygen valgrind check check-devel
817 MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
822 extends: .fedora-custom-build@meson-template
824 MESON_ARGS: '-Dcoverity=true'
827 extends: .fedora-custom-build@meson-template
829 NINJA_ARGS: 'scan-build'
833 extends: .fedora-custom-build@meson-template
835 - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
836 - ninja -C "$MESON_BUILDDIR" install
837 - ls -l $PWD/prefix-meson/lib64/libevdev.a
844 - ./autogen.sh --prefix=$PWD/prefix-autotools/
846 - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
847 - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
848 - ninja -C "$MESON_BUILDDIR" install
849 - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
850 needs: ['fedora:31@container-prep']
852 #################################################################
856 #################################################################
858 .check_tainted: &check_tainted |
859 # make sure the kernel is not tainted
860 if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
862 echo tainted kernel ;
870 image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
874 MESON_BUILDDIR: build_dir
876 # start our vm, no args required
881 - "scp -P 5555 -r $PWD localhost:"
882 - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
883 - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
884 - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
885 - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
886 - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
887 - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
888 - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
889 # no matter the results of the tests, we want to fetch the logs
890 - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
894 - ssh localhost -p 5555 halt || true
898 - if [[ ! -e .success ]] ;
903 name: "qemu-meson-logs-$CI_JOB_NAME"
907 - $MESON_BUILDDIR/meson-logs
910 junit: $MESON_BUILDDIR/junit-*.xml
915 needs: ['fedora:31@qemu-prep']
918 extends: .qemu@fedora:31
921 extends: .qemu@fedora:31
923 MESON_TEST_ARGS: '--setup=valgrind'
930 - export INSTALLDIR="$PWD/_inst"
932 - pushd _build > /dev/null
933 - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
937 - mkdir -p _tarball_dir
938 - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
939 - pushd _tarball_dir/libevdev-*/ > /dev/null
940 - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
941 - ninja -C "$MESON_BUILDDIR" test
942 - ninja -C "$MESON_BUILDDIR" install
945 needs: ['fedora:31@container-prep']
947 autotools-from-tarball:
952 - export INSTALLDIR="$PWD/_inst"
953 - meson "$MESON_BUILDDIR"
954 - ninja -C "$MESON_BUILDDIR" dist
955 - mkdir -p _tarball_dir
956 - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
957 - pushd _tarball_dir/libevdev-*/ > /dev/null
959 - pushd _build > /dev/null
960 - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
967 needs: ['fedora:31@container-prep']