1 ########################################
3 # THIS FILE IS GENERATED, DO NOT EDIT #
5 ########################################
7 .templates_sha: &template_sha 2469555cd0a6b621b988e100ddd746c2ad0cdd1d # 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-06.0'
83 FDO_DISTRIBUTION_VERSION: '30'
86 extends: .fdo.distribution_image@fedora
88 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
89 FDO_DISTRIBUTION_VERSION: '31'
92 extends: .fdo.distribution_image@ubuntu
94 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
95 FDO_DISTRIBUTION_VERSION: '19.10'
98 extends: .fdo.distribution_image@ubuntu
100 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
101 FDO_DISTRIBUTION_VERSION: '19.04'
104 extends: .fdo.distribution_image@debian
106 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
107 FDO_DISTRIBUTION_VERSION: 'stable'
110 extends: .fdo.distribution_image@debian
112 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
113 FDO_DISTRIBUTION_VERSION: 'sid'
116 extends: .fdo.distribution_image@centos
118 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
119 FDO_DISTRIBUTION_VERSION: '7'
122 extends: .fdo.distribution_image@centos
124 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
125 FDO_DISTRIBUTION_VERSION: '8'
128 extends: .fdo.distribution_image@arch
130 FDO_DISTRIBUTION_TAG: '2020-03-06.0'
131 FDO_DISTRIBUTION_VERSION: 'rolling'
134 extends: .fdo.distribution_image@alpine
136 FDO_DISTRIBUTION_TAG: '2020-03-06.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
188 .pull_upstream_or_rebuild:
190 # log in to the registry
191 - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
193 # get the full container image name (FDO_DISTRIBUTION_VERSION still has indirections)
194 - IMAGE=$(eval echo "$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG")
197 # force rebuild if schedule, reuse otherwise
198 if [[ $CI_PIPELINE_SOURCE != "schedule" ]] ;
200 # pull the latest upstream image if it exists
201 skopeo copy docker://$CI_REGISTRY/$FDO_UPSTREAM_REPO/$IMAGE \
202 docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
204 # check if our image is already in the current registry
205 skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
208 .fedora:30@qemu-prep:
211 - .fdo.qemu-build@fedora
212 - .pull_upstream_or_rebuild
218 FDO_DISTRIBUTION_TAG: qemu-2020-03-06.0
219 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
222 .fedora:31@qemu-prep:
225 - .fdo.qemu-build@fedora
226 - .pull_upstream_or_rebuild
232 FDO_DISTRIBUTION_TAG: qemu-2020-03-06.0
233 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
238 extends: .fedora:31@qemu-prep
242 fedora:30@container-prep:
245 - .fdo.container-build@fedora
246 - .pull_upstream_or_rebuild
250 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
254 fedora:31@container-prep:
257 - .fdo.container-build@fedora
258 - .pull_upstream_or_rebuild
262 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
266 ubuntu:19.10@container-prep:
269 - .fdo.container-build@ubuntu
270 - .pull_upstream_or_rebuild
274 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
278 ubuntu:19.04@container-prep:
281 - .fdo.container-build@ubuntu
282 - .pull_upstream_or_rebuild
286 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
290 debian:stable@container-prep:
293 - .fdo.container-build@debian
294 - .pull_upstream_or_rebuild
298 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
302 debian:sid@container-prep:
305 - .fdo.container-build@debian
306 - .pull_upstream_or_rebuild
310 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
314 centos:7@container-prep:
317 - .fdo.container-build@centos
318 - .pull_upstream_or_rebuild
322 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
326 centos:8@container-prep:
329 - .fdo.container-build@centos
330 - .pull_upstream_or_rebuild
334 FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
338 arch:rolling@container-prep:
341 - .fdo.container-build@arch
342 - .pull_upstream_or_rebuild
346 FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
350 alpine:latest@container-prep:
353 - .fdo.container-build@alpine
354 - .pull_upstream_or_rebuild
358 FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
361 #################################################################
363 # container clean stage #
364 # run during the clean stage #
366 #################################################################
369 # This stage will look for the container images we currently have in
370 # the registry and will remove any that are not tagged with the provided
371 # $container_image:$tag
373 stage: container_clean
377 - pip3 install --user python-gitlab
379 - LATEST_TAG=$(echo $DISTRO_CONTAINER_IMAGE | cut -f2 -d:)
380 # Go to your Profile, Settings, Access Tokens
381 # Create a personal token with 'api' scope, copy the value.
382 # Go to Settings, CI/CD, Variables
383 # Define a variable of type File named AUTHFILE. Content is that token
385 - python3 .gitlab-ci/gitlab-container-delete $CI_SERVER_URL $CI_PROJECT_PATH
386 --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
387 --authfile $AUTHFILE --exclude-tag "$LATEST_TAG"
394 fedora:30@container-clean:
398 needs: ["fedora:30@container-prep"]
401 fedora:31@container-clean:
405 needs: ["fedora:31@container-prep"]
408 ubuntu:19.10@container-clean:
412 needs: ["ubuntu:19.10@container-prep"]
415 ubuntu:19.04@container-clean:
419 needs: ["ubuntu:19.04@container-prep"]
422 debian:stable@container-clean:
426 needs: ["debian:stable@container-prep"]
429 debian:sid@container-clean:
433 needs: ["debian:sid@container-prep"]
436 centos:7@container-clean:
440 needs: ["centos:7@container-prep"]
443 centos:8@container-clean:
447 needs: ["centos:8@container-prep"]
450 arch:rolling@container-clean:
454 needs: ["arch:rolling@container-prep"]
457 alpine:latest@container-clean:
461 needs: ["alpine:latest@container-prep"]
464 #################################################################
468 #################################################################
470 .autotools-build@template:
476 MAKE_ARGS: "distcheck"
478 .meson-build@template:
487 fedora:30@autotools-build:
490 - .autotools-build@template
492 needs: ['fedora:30@container-prep']
494 fedora:30@meson-build:
497 - .meson-build@template
499 needs: ['fedora:30@container-prep']
502 fedora:31@autotools-build:
505 - .autotools-build@template
507 needs: ['fedora:31@container-prep']
509 fedora:31@meson-build:
512 - .meson-build@template
514 needs: ['fedora:31@container-prep']
517 ubuntu:19.10@autotools-build:
520 - .autotools-build@template
522 needs: ['ubuntu:19.10@container-prep']
524 ubuntu:19.10@meson-build:
527 - .meson-build@template
529 needs: ['ubuntu:19.10@container-prep']
532 ubuntu:19.04@autotools-build:
535 - .autotools-build@template
537 needs: ['ubuntu:19.04@container-prep']
539 ubuntu:19.04@meson-build:
542 - .meson-build@template
544 needs: ['ubuntu:19.04@container-prep']
547 debian:stable@autotools-build:
550 - .autotools-build@template
552 needs: ['debian:stable@container-prep']
554 debian:stable@meson-build:
557 - .meson-build@template
559 needs: ['debian:stable@container-prep']
562 debian:sid@autotools-build:
565 - .autotools-build@template
567 needs: ['debian:sid@container-prep']
569 debian:sid@meson-build:
572 - .meson-build@template
574 needs: ['debian:sid@container-prep']
577 centos:7@autotools-build:
580 - .autotools-build@template
583 MAKE_ARGS: '' # disable distcheck, requires doxygen
584 needs: ['centos:7@container-prep']
588 centos:8@autotools-build:
591 - .autotools-build@template
594 MAKE_ARGS: '' # disable distcheck, requires doxygen
595 needs: ['centos:8@container-prep']
599 arch:rolling@autotools-build:
602 - .autotools-build@template
604 needs: ['arch:rolling@container-prep']
606 arch:rolling@meson-build:
609 - .meson-build@template
611 needs: ['arch:rolling@container-prep']
614 alpine:latest@autotools-build:
617 - .autotools-build@template
619 needs: ['alpine:latest@container-prep']
621 alpine:latest@meson-build:
624 - .meson-build@template
626 needs: ['alpine:latest@container-prep']
629 # Build argument tests
631 # We only run the build option combinations on one image
632 # because they're supposed to fail equally on all
633 .fedora-custom-build@autotools-template:
636 - .autotools-build@template
638 needs: ['fedora:31@container-prep']
640 no-valgrind:autotools:
641 extends: .fedora-custom-build@autotools-template
643 - dnf remove -y valgrind
646 extends: .fedora-custom-build@autotools-template
648 - dnf remove -y check check-devel
650 no-doxygen:autotools:
651 extends: .fedora-custom-build@autotools-template
653 - dnf remove -y doxygen
655 MAKE_ARGS: '' # disable distcheck, requires doxygen
657 # doxygen is required for distcheck
658 no-doxygen-check-valgrind:autotools:
659 extends: .fedora-custom-build@autotools-template
661 - dnf remove -y doxygen valgrind check check-devel
663 MAKE_ARGS: '' # disable distcheck, requires doxygen
666 extends: .fedora-custom-build@autotools-template
668 - mv /usr/bin/nm /usr/bin/nm.moved
670 enable-gcov:autotools:
671 extends: .fedora-custom-build@autotools-template
673 CONFIGURE_FLAGS: "--enable-gcov"
675 .fedora-custom-build@meson-template:
678 - .meson-build@template
680 needs: ['fedora:31@container-prep']
683 extends: .fedora-custom-build@meson-template
685 - dnf remove -y valgrind
688 extends: .fedora-custom-build@meson-template
690 - dnf remove -y check check-devel
692 MESON_ARGS: -Dtests=disabled
695 # doxygen is required for dist
697 extends: .fedora-custom-build@meson-template
699 - dnf remove -y doxygen
701 MESON_ARGS: -Ddocumentation=disabled
704 # doxygen is required for dist
705 no-doxygen-check-valgrind:meson:
706 extends: .fedora-custom-build@meson-template
708 - dnf remove -y doxygen valgrind check check-devel
710 MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
715 extends: .fedora-custom-build@meson-template
717 MESON_ARGS: '-Dcoverity=true'
720 extends: .fedora-custom-build@meson-template
722 NINJA_ARGS: 'scan-build'
726 extends: .fedora-custom-build@meson-template
728 - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
729 - ninja -C "$MESON_BUILDDIR" install
730 - ls -l $PWD/prefix-meson/lib64/libevdev.a
737 - ./autogen.sh --prefix=$PWD/prefix-autotools/
739 - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
740 - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
741 - ninja -C "$MESON_BUILDDIR" install
742 - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
743 needs: ['fedora:31@container-prep']
745 #################################################################
749 #################################################################
751 .check_tainted: &check_tainted |
752 # make sure the kernel is not tainted
753 if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
755 echo tainted kernel ;
763 image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
767 MESON_BUILDDIR: build_dir
769 # start our vm, no args required
774 - "scp -P 5555 -r $PWD localhost:"
775 - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
776 - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
777 - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
778 - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
779 - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
780 - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
781 - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
782 # no matter the results of the tests, we want to fetch the logs
783 - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
787 - ssh localhost -p 5555 halt || true
791 - if [[ ! -e .success ]] ;
796 name: "qemu-meson-logs-$CI_JOB_NAME"
800 - $MESON_BUILDDIR/meson-logs
803 junit: $MESON_BUILDDIR/junit-*.xml
808 needs: ['fedora:31@qemu-prep']
811 extends: .qemu@fedora:31
814 extends: .qemu@fedora:31
816 MESON_TEST_ARGS: '--setup=valgrind'
823 - export INSTALLDIR="$PWD/_inst"
825 - pushd _build > /dev/null
826 - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
830 - mkdir -p _tarball_dir
831 - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
832 - pushd _tarball_dir/libevdev-*/ > /dev/null
833 - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
834 - ninja -C "$MESON_BUILDDIR" test
835 - ninja -C "$MESON_BUILDDIR" install
838 needs: ['fedora:31@container-prep']
840 autotools-from-tarball:
845 - export INSTALLDIR="$PWD/_inst"
846 - meson "$MESON_BUILDDIR"
847 - ninja -C "$MESON_BUILDDIR" dist
848 - mkdir -p _tarball_dir
849 - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
850 - pushd _tarball_dir/libevdev-*/ > /dev/null
852 - pushd _build > /dev/null
853 - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
860 needs: ['fedora:31@container-prep']