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: '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 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"
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
483 - apk add python3 git
484 - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
486 # Go to your Profile, Settings, Access Tokens
487 # Create a personal token with 'api' scope, copy the value.
488 # Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
489 # Define a variable of type File named AUTHFILE. Content is that token
491 - ci-fairy -v --authfile $AUTHFILE delete-image
492 --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
493 --exclude-tag $FDO_DISTRIBUTION_TAG
500 fedora:30@container-clean:
504 needs: ["fedora:30@container-prep"]
507 fedora:31@container-clean:
511 needs: ["fedora:31@container-prep"]
514 ubuntu:19.10@container-clean:
518 needs: ["ubuntu:19.10@container-prep"]
521 ubuntu:19.04@container-clean:
525 needs: ["ubuntu:19.04@container-prep"]
528 debian:stable@container-clean:
532 needs: ["debian:stable@container-prep"]
535 debian:sid@container-clean:
539 needs: ["debian:sid@container-prep"]
542 centos:7@container-clean:
546 needs: ["centos:7@container-prep"]
549 centos:8@container-clean:
553 needs: ["centos:8@container-prep"]
556 arch:rolling@container-clean:
560 needs: ["arch:rolling@container-prep"]
563 alpine:latest@container-clean:
567 needs: ["alpine:latest@container-prep"]
570 #################################################################
574 #################################################################
576 .autotools-build@template:
582 MAKE_ARGS: "distcheck"
584 .meson-build@template:
593 fedora:30@autotools-build:
596 - .autotools-build@template
598 needs: ['fedora:30@container-prep']
600 fedora:30@meson-build:
603 - .meson-build@template
605 needs: ['fedora:30@container-prep']
608 fedora:31@autotools-build:
611 - .autotools-build@template
613 needs: ['fedora:31@container-prep']
615 fedora:31@meson-build:
618 - .meson-build@template
620 needs: ['fedora:31@container-prep']
623 ubuntu:19.10@autotools-build:
626 - .autotools-build@template
628 needs: ['ubuntu:19.10@container-prep']
630 ubuntu:19.10@meson-build:
633 - .meson-build@template
635 needs: ['ubuntu:19.10@container-prep']
638 ubuntu:19.04@autotools-build:
641 - .autotools-build@template
643 needs: ['ubuntu:19.04@container-prep']
645 ubuntu:19.04@meson-build:
648 - .meson-build@template
650 needs: ['ubuntu:19.04@container-prep']
653 debian:stable@autotools-build:
656 - .autotools-build@template
658 needs: ['debian:stable@container-prep']
660 debian:stable@meson-build:
663 - .meson-build@template
665 needs: ['debian:stable@container-prep']
668 debian:sid@autotools-build:
671 - .autotools-build@template
673 needs: ['debian:sid@container-prep']
675 debian:sid@meson-build:
678 - .meson-build@template
680 needs: ['debian:sid@container-prep']
683 centos:7@autotools-build:
686 - .autotools-build@template
689 MAKE_ARGS: '' # disable distcheck, requires doxygen
690 needs: ['centos:7@container-prep']
694 centos:8@autotools-build:
697 - .autotools-build@template
700 MAKE_ARGS: '' # disable distcheck, requires doxygen
701 needs: ['centos:8@container-prep']
705 arch:rolling@autotools-build:
708 - .autotools-build@template
710 needs: ['arch:rolling@container-prep']
712 arch:rolling@meson-build:
715 - .meson-build@template
717 needs: ['arch:rolling@container-prep']
720 alpine:latest@autotools-build:
723 - .autotools-build@template
725 needs: ['alpine:latest@container-prep']
727 alpine:latest@meson-build:
730 - .meson-build@template
732 needs: ['alpine:latest@container-prep']
735 # Build argument tests
737 # We only run the build option combinations on one image
738 # because they're supposed to fail equally on all
739 .fedora-custom-build@autotools-template:
742 - .autotools-build@template
744 needs: ['fedora:31@container-prep']
746 no-valgrind:autotools:
747 extends: .fedora-custom-build@autotools-template
749 - dnf remove -y valgrind
752 extends: .fedora-custom-build@autotools-template
754 - dnf remove -y check check-devel
756 no-doxygen:autotools:
757 extends: .fedora-custom-build@autotools-template
759 - dnf remove -y doxygen
761 MAKE_ARGS: '' # disable distcheck, requires doxygen
763 # doxygen is required for distcheck
764 no-doxygen-check-valgrind:autotools:
765 extends: .fedora-custom-build@autotools-template
767 - dnf remove -y doxygen valgrind check check-devel
769 MAKE_ARGS: '' # disable distcheck, requires doxygen
772 extends: .fedora-custom-build@autotools-template
774 - mv /usr/bin/nm /usr/bin/nm.moved
776 enable-gcov:autotools:
777 extends: .fedora-custom-build@autotools-template
779 CONFIGURE_FLAGS: "--enable-gcov"
781 .fedora-custom-build@meson-template:
784 - .meson-build@template
786 needs: ['fedora:31@container-prep']
789 extends: .fedora-custom-build@meson-template
791 - dnf remove -y valgrind
794 extends: .fedora-custom-build@meson-template
796 - dnf remove -y check check-devel
798 MESON_ARGS: -Dtests=disabled
801 # doxygen is required for dist
803 extends: .fedora-custom-build@meson-template
805 - dnf remove -y doxygen
807 MESON_ARGS: -Ddocumentation=disabled
810 # doxygen is required for dist
811 no-doxygen-check-valgrind:meson:
812 extends: .fedora-custom-build@meson-template
814 - dnf remove -y doxygen valgrind check check-devel
816 MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
821 extends: .fedora-custom-build@meson-template
823 MESON_ARGS: '-Dcoverity=true'
826 extends: .fedora-custom-build@meson-template
828 NINJA_ARGS: 'scan-build'
832 extends: .fedora-custom-build@meson-template
834 - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
835 - ninja -C "$MESON_BUILDDIR" install
836 - ls -l $PWD/prefix-meson/lib64/libevdev.a
843 - ./autogen.sh --prefix=$PWD/prefix-autotools/
845 - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
846 - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
847 - ninja -C "$MESON_BUILDDIR" install
848 - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
849 needs: ['fedora:31@container-prep']
851 #################################################################
855 #################################################################
857 .check_tainted: &check_tainted |
858 # make sure the kernel is not tainted
859 if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
861 echo tainted kernel ;
869 image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
873 MESON_BUILDDIR: build_dir
875 # start our vm, no args required
880 - "scp -P 5555 -r $PWD localhost:"
881 - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
882 - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
883 - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
884 - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
885 - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
886 - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
887 - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
888 # no matter the results of the tests, we want to fetch the logs
889 - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
893 - ssh localhost -p 5555 halt || true
897 - if [[ ! -e .success ]] ;
902 name: "qemu-meson-logs-$CI_JOB_NAME"
906 - $MESON_BUILDDIR/meson-logs
909 junit: $MESON_BUILDDIR/junit-*.xml
914 needs: ['fedora:31@qemu-prep']
917 extends: .qemu@fedora:31
920 extends: .qemu@fedora:31
922 MESON_TEST_ARGS: '--setup=valgrind'
929 - export INSTALLDIR="$PWD/_inst"
931 - pushd _build > /dev/null
932 - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
936 - mkdir -p _tarball_dir
937 - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
938 - pushd _tarball_dir/libevdev-*/ > /dev/null
939 - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
940 - ninja -C "$MESON_BUILDDIR" test
941 - ninja -C "$MESON_BUILDDIR" install
944 needs: ['fedora:31@container-prep']
946 autotools-from-tarball:
951 - export INSTALLDIR="$PWD/_inst"
952 - meson "$MESON_BUILDDIR"
953 - ninja -C "$MESON_BUILDDIR" dist
954 - mkdir -p _tarball_dir
955 - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
956 - pushd _tarball_dir/libevdev-*/ > /dev/null
958 - pushd _build > /dev/null
959 - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
966 needs: ['fedora:31@container-prep']