1 ########################################
3 # THIS FILE IS GENERATED, DO NOT EDIT #
5 ########################################
7 .templates_sha: &template_sha ca99d9418390fb5faaa7f2407b94c733d7ec6a37 # 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: '20.04'
98 extends: .fdo.distribution-image@ubuntu
100 FDO_DISTRIBUTION_TAG: '2020-03-17.0'
101 FDO_DISTRIBUTION_VERSION: '19.10'
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 py-pip git
156 - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
158 - ci-fairy generate-template
159 - git diff --exit-code && exit 0 || true
160 - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
164 # Verify that commit messages are as expected, signed-off, etc.
171 - apk add python3 py-pip git
172 - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
174 - ci-fairy check-commits --signed-off-by --junit-xml=results.xml
176 - master@libevdev/libevdev
184 # Verify that the merge request has the allow-collaboration checkbox ticked
191 - apk add python3 py-pip git
192 - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
194 - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
204 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
208 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
212 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
216 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
220 FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
224 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
227 # Pulls in the qemu container from upstream or rebuilds it if missing
228 .fedora:30@qemu-prep:
232 - .fdo.qemu-build@fedora
238 FDO_DISTRIBUTION_TAG: qemu-2020-03-17.0
241 # Always rebuilds the container
242 .fedora:30@qemu-forced-rebuild:
244 - .fedora:30@qemu-prep
250 # Pulls in the qemu container from upstream or rebuilds it if missing
251 .fedora:31@qemu-prep:
255 - .fdo.qemu-build@fedora
261 FDO_DISTRIBUTION_TAG: qemu-2020-03-17.0
264 # Always rebuilds the container
265 .fedora:31@qemu-forced-rebuild:
267 - .fedora:31@qemu-prep
274 # This is the actual job
276 extends: .fedora:31@qemu-prep
278 fedora:31@qemu-forced-rebuild:
279 extends: .fedora:31@qemu-forced-rebuild
282 # Pulls in the container from upstream or rebuilds it if missing
283 fedora:30@container-prep:
287 - .fdo.container-build@fedora
292 # Always rebuilds the container
293 fedora:30@container-forced-rebuild:
295 - fedora:30@container-prep
302 # Pulls in the container from upstream or rebuilds it if missing
303 fedora:31@container-prep:
307 - .fdo.container-build@fedora
312 # Always rebuilds the container
313 fedora:31@container-forced-rebuild:
315 - fedora:31@container-prep
322 # Pulls in the container from upstream or rebuilds it if missing
323 ubuntu:20.04@container-prep:
327 - .fdo.container-build@ubuntu
332 # Always rebuilds the container
333 ubuntu:20.04@container-forced-rebuild:
335 - ubuntu:20.04@container-prep
342 # Pulls in the container from upstream or rebuilds it if missing
343 ubuntu:19.10@container-prep:
347 - .fdo.container-build@ubuntu
352 # Always rebuilds the container
353 ubuntu:19.10@container-forced-rebuild:
355 - ubuntu:19.10@container-prep
362 # Pulls in the container from upstream or rebuilds it if missing
363 debian:stable@container-prep:
367 - .fdo.container-build@debian
372 # Always rebuilds the container
373 debian:stable@container-forced-rebuild:
375 - debian:stable@container-prep
382 # Pulls in the container from upstream or rebuilds it if missing
383 debian:sid@container-prep:
387 - .fdo.container-build@debian
392 # Always rebuilds the container
393 debian:sid@container-forced-rebuild:
395 - debian:sid@container-prep
402 # Pulls in the container from upstream or rebuilds it if missing
403 centos:7@container-prep:
407 - .fdo.container-build@centos
412 # Always rebuilds the container
413 centos:7@container-forced-rebuild:
415 - centos:7@container-prep
422 # Pulls in the container from upstream or rebuilds it if missing
423 centos:8@container-prep:
427 - .fdo.container-build@centos
432 # Always rebuilds the container
433 centos:8@container-forced-rebuild:
435 - centos:8@container-prep
442 # Pulls in the container from upstream or rebuilds it if missing
443 arch:rolling@container-prep:
447 - .fdo.container-build@arch
452 # Always rebuilds the container
453 arch:rolling@container-forced-rebuild:
455 - arch:rolling@container-prep
462 # Pulls in the container from upstream or rebuilds it if missing
463 alpine:latest@container-prep:
467 - .fdo.container-build@alpine
472 # Always rebuilds the container
473 alpine:latest@container-forced-rebuild:
475 - alpine:latest@container-prep
482 #################################################################
484 # container clean stage #
485 # run during the clean stage #
487 #################################################################
490 # This stage will look for the container images we currently have in
491 # the registry and will remove any that are not tagged with the provided
492 # $container_image:$tag
494 stage: container_clean
497 - apk add python3 py-pip git
498 - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
500 # Go to your Profile, Settings, Access Tokens
501 # Create a personal token with 'api' scope, copy the value.
502 # Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
503 # Define a variable of type File named AUTHFILE. Content is that token
505 - ci-fairy -v --authfile $AUTHFILE delete-image
506 --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
507 --exclude-tag $FDO_DISTRIBUTION_TAG
514 fedora:30@container-clean:
518 needs: ["fedora:30@container-prep"]
521 fedora:31@container-clean:
525 needs: ["fedora:31@container-prep"]
528 ubuntu:20.04@container-clean:
532 needs: ["ubuntu:20.04@container-prep"]
535 ubuntu:19.10@container-clean:
539 needs: ["ubuntu:19.10@container-prep"]
542 debian:stable@container-clean:
546 needs: ["debian:stable@container-prep"]
549 debian:sid@container-clean:
553 needs: ["debian:sid@container-prep"]
556 centos:7@container-clean:
560 needs: ["centos:7@container-prep"]
563 centos:8@container-clean:
567 needs: ["centos:8@container-prep"]
570 arch:rolling@container-clean:
574 needs: ["arch:rolling@container-prep"]
577 alpine:latest@container-clean:
581 needs: ["alpine:latest@container-prep"]
584 #################################################################
588 #################################################################
590 .autotools-build@template:
596 MAKE_ARGS: "distcheck"
598 .meson-build@template:
607 fedora:30@autotools-build:
610 - .autotools-build@template
612 needs: ['fedora:30@container-prep']
614 fedora:30@meson-build:
617 - .meson-build@template
619 needs: ['fedora:30@container-prep']
622 fedora:31@autotools-build:
625 - .autotools-build@template
627 needs: ['fedora:31@container-prep']
629 fedora:31@meson-build:
632 - .meson-build@template
634 needs: ['fedora:31@container-prep']
637 ubuntu:20.04@autotools-build:
640 - .autotools-build@template
642 needs: ['ubuntu:20.04@container-prep']
644 ubuntu:20.04@meson-build:
647 - .meson-build@template
649 needs: ['ubuntu:20.04@container-prep']
652 ubuntu:19.10@autotools-build:
655 - .autotools-build@template
657 needs: ['ubuntu:19.10@container-prep']
659 ubuntu:19.10@meson-build:
662 - .meson-build@template
664 needs: ['ubuntu:19.10@container-prep']
667 debian:stable@autotools-build:
670 - .autotools-build@template
672 needs: ['debian:stable@container-prep']
674 debian:stable@meson-build:
677 - .meson-build@template
679 needs: ['debian:stable@container-prep']
682 debian:sid@autotools-build:
685 - .autotools-build@template
687 needs: ['debian:sid@container-prep']
689 debian:sid@meson-build:
692 - .meson-build@template
694 needs: ['debian:sid@container-prep']
697 centos:7@autotools-build:
700 - .autotools-build@template
703 MAKE_ARGS: '' # disable distcheck, requires doxygen
704 needs: ['centos:7@container-prep']
708 centos:8@autotools-build:
711 - .autotools-build@template
714 MAKE_ARGS: '' # disable distcheck, requires doxygen
715 needs: ['centos:8@container-prep']
719 arch:rolling@autotools-build:
722 - .autotools-build@template
724 needs: ['arch:rolling@container-prep']
726 arch:rolling@meson-build:
729 - .meson-build@template
731 needs: ['arch:rolling@container-prep']
734 alpine:latest@autotools-build:
737 - .autotools-build@template
739 needs: ['alpine:latest@container-prep']
741 alpine:latest@meson-build:
744 - .meson-build@template
746 needs: ['alpine:latest@container-prep']
749 # Build argument tests
751 # We only run the build option combinations on one image
752 # because they're supposed to fail equally on all
753 .fedora-custom-build@autotools-template:
756 - .autotools-build@template
758 needs: ['fedora:31@container-prep']
760 no-valgrind:autotools:
761 extends: .fedora-custom-build@autotools-template
763 - dnf remove -y valgrind
766 extends: .fedora-custom-build@autotools-template
768 - dnf remove -y check check-devel
770 no-doxygen:autotools:
771 extends: .fedora-custom-build@autotools-template
773 - dnf remove -y doxygen
775 MAKE_ARGS: '' # disable distcheck, requires doxygen
777 # doxygen is required for distcheck
778 no-doxygen-check-valgrind:autotools:
779 extends: .fedora-custom-build@autotools-template
781 - dnf remove -y doxygen valgrind check check-devel
783 MAKE_ARGS: '' # disable distcheck, requires doxygen
786 extends: .fedora-custom-build@autotools-template
788 - mv /usr/bin/nm /usr/bin/nm.moved
790 enable-gcov:autotools:
791 extends: .fedora-custom-build@autotools-template
793 CONFIGURE_FLAGS: "--enable-gcov"
795 .fedora-custom-build@meson-template:
798 - .meson-build@template
800 needs: ['fedora:31@container-prep']
803 extends: .fedora-custom-build@meson-template
805 - dnf remove -y valgrind
808 extends: .fedora-custom-build@meson-template
810 - dnf remove -y check check-devel
812 MESON_ARGS: -Dtests=disabled
815 # doxygen is required for dist
817 extends: .fedora-custom-build@meson-template
819 - dnf remove -y doxygen
821 MESON_ARGS: -Ddocumentation=disabled
824 # doxygen is required for dist
825 no-doxygen-check-valgrind:meson:
826 extends: .fedora-custom-build@meson-template
828 - dnf remove -y doxygen valgrind check check-devel
830 MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
835 extends: .fedora-custom-build@meson-template
837 MESON_ARGS: '-Dcoverity=true'
840 extends: .fedora-custom-build@meson-template
842 NINJA_ARGS: 'scan-build'
846 extends: .fedora-custom-build@meson-template
848 - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
849 - ninja -C "$MESON_BUILDDIR" install
850 - ls -l $PWD/prefix-meson/lib64/libevdev.a
857 - ./autogen.sh --prefix=$PWD/prefix-autotools/
859 - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
860 - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
861 - ninja -C "$MESON_BUILDDIR" install
862 - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
863 needs: ['fedora:31@container-prep']
865 #################################################################
869 #################################################################
871 .check_tainted: &check_tainted |
872 # make sure the kernel is not tainted
873 if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
875 echo tainted kernel ;
883 image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
887 MESON_BUILDDIR: build_dir
889 # start our vm, no args required
894 - "scp -P 5555 -r $PWD localhost:"
895 - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
896 - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
897 - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
898 - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
899 - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
900 - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
901 - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
902 # no matter the results of the tests, we want to fetch the logs
903 - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
907 - ssh localhost -p 5555 halt || true
911 - if [[ ! -e .success ]] ;
916 name: "qemu-meson-logs-$CI_JOB_NAME"
920 - $MESON_BUILDDIR/meson-logs
923 junit: $MESON_BUILDDIR/junit-*.xml
928 needs: ['fedora:31@qemu-prep']
931 extends: .qemu@fedora:31
934 extends: .qemu@fedora:31
936 MESON_TEST_ARGS: '--setup=valgrind'
943 - export INSTALLDIR="$PWD/_inst"
945 - pushd _build > /dev/null
946 - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
950 - mkdir -p _tarball_dir
951 - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
952 - pushd _tarball_dir/libevdev-*/ > /dev/null
953 - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
954 - ninja -C "$MESON_BUILDDIR" test
955 - ninja -C "$MESON_BUILDDIR" install
958 needs: ['fedora:31@container-prep']
960 autotools-from-tarball:
965 - export INSTALLDIR="$PWD/_inst"
966 - meson "$MESON_BUILDDIR"
967 - ninja -C "$MESON_BUILDDIR" dist
968 - mkdir -p _tarball_dir
969 - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
970 - pushd _tarball_dir/libevdev-*/ > /dev/null
972 - pushd _build > /dev/null
973 - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
980 needs: ['fedora:31@container-prep']