1 # vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
3 # THIS FILE IS GENERATED, DO NOT EDIT
5 .templates_sha: &template_sha 01f2a6a8ab5cd31000c1c14a1acfff68ea98b59e # see https://docs.gitlab.com/ee/ci/yaml/#includefile
8 # Alpine container builder template
9 - project: 'wayland/ci-templates'
10 file: '/templates/alpine.yml'
11 # Arch container builder template
12 - project: 'wayland/ci-templates'
14 file: '/templates/arch.yml'
15 # Fedora container builder template
16 - project: 'wayland/ci-templates'
18 file: '/templates/fedora.yml'
19 # Ubuntu container builder template
20 - project: 'wayland/ci-templates'
22 file: '/templates/ubuntu.yml'
23 # Debian container builder template
24 - project: 'wayland/ci-templates'
26 file: '/templates/debian.yml'
27 # CentOS container builder template
28 - project: 'wayland/ci-templates'
30 file: '/templates/centos.yml'
33 - prep # rebuild the container images if there is a change
34 - build # for actually building and testing things in a container
35 - VM # for running the test suite in a VM
36 - autotools # distribution builds with autotools
37 - meson # distribution builds with meson
38 - deploy # trigger wayland's website generation
39 - container_clean # clean up unused container images
42 ###############################################################################
43 # This is the list of packages required to build libevdev with the default #
46 # Run dnf install/apt-get install/.. with the list of packages for your #
48 ###############################################################################
49 FEDORA_RPMS: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz'
50 CENTOS_RPMS: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
51 UBUNTU_DEBS: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
52 DEBIAN_DEBS: $UBUNTU_DEBS
53 ARCH_PKGS: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
54 ALPINE_PKGS: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
55 ############################ end of package lists #############################
56 # these tags should be updated each time the list of packages is updated
57 # changing these will force rebuilding the associated image
58 # Note: these tags have no meaning and are not tied to a particular
60 FEDORA_TAG: '2020-02-17.1'
61 CENTOS_TAG: '2020-02-17.1'
62 DEBIAN_TAG: '2020-02-17.1'
63 UBUNTU_TAG: '2020-02-17.1'
64 ARCH_TAG: '2020-02-17.1'
65 ALPINE_TAG: '2020-02-17.1'
67 UPSTREAM_REPO: libevdev/libevdev
68 BUILDAH_IMAGE: $CI_REGISTRY/wayland/ci-templates/buildah:latest
69 FEDORA_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FEDORA_VERSION:$FEDORA_TAG
70 CENTOS_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$CENTOS_VERSION:$CENTOS_TAG
71 UBUNTU_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$UBUNTU_VERSION:$UBUNTU_TAG
72 DEBIAN_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG
73 ARCH_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/archlinux/rolling:$ARCH_TAG
74 ALPINE_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/alpine/latest:$ALPINE_TAG
76 LIBEVDEV_SKIP_ROOT_TESTS: 1
82 - _build/test/test-suite.log
83 - builddir/meson-logs/testlog-*.txt
94 - pushd _build > /dev/null
95 - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
98 - if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
105 - meson builddir $MESON_ARGS
106 - ninja -C builddir $NINJA_ARGS
108 #################################################################
112 #################################################################
114 # Re-generate the CI script and make sure it's the one currently checked in
115 # If this job fails, re-generate the gitlab-ci.yml script, see
116 # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
122 - apk add python3 git
123 - pip3 install --user jinja2
125 - python3 ./.gitlab-ci/generate-gitlab-ci.py
126 - git diff --exit-code && exit 0 || true
127 - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
134 - apk add python3 git
136 - pip3 install GitPython
137 - pip3 install pytest
139 pytest --junitxml=results.xml \
142 ./.gitlab-ci/check-commit.py
144 - master@libevdev/libevdev
151 .pull_upstream_or_rebuild:
153 # log in to the registry
154 - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
156 # get the full container image name (DISTRIB_VERSION still has indirections)
157 - IMAGE=$(eval echo "$DISTRIB_FLAVOR/$DISTRIB_VERSION:$TAG")
160 # force rebuild if schedule, reuse otherwise
161 if [[ $CI_PIPELINE_SOURCE != "schedule" ]] ;
163 # pull the latest upstream image if it exists
164 skopeo copy docker://$CI_REGISTRY/$UPSTREAM_REPO/$IMAGE \
165 docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
167 # check if our image is already in the current registry
168 skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
173 fedora:30@container-prep:
175 - .fedora@container-build
176 - .pull_upstream_or_rebuild
181 DISTRIB_FLAVOR: fedora
182 DISTRIB_VERSION: $FEDORA_VERSION
187 fedora:31@container-prep:
189 - .fedora@container-build
190 - .pull_upstream_or_rebuild
195 DISTRIB_FLAVOR: fedora
196 DISTRIB_VERSION: $FEDORA_VERSION
201 ubuntu:19.10@container-prep:
203 - .ubuntu@container-build
204 - .pull_upstream_or_rebuild
208 UBUNTU_VERSION: '19.10'
209 DISTRIB_FLAVOR: ubuntu
210 DISTRIB_VERSION: $UBUNTU_VERSION
215 ubuntu:19.04@container-prep:
217 - .ubuntu@container-build
218 - .pull_upstream_or_rebuild
222 UBUNTU_VERSION: '19.04'
223 DISTRIB_FLAVOR: ubuntu
224 DISTRIB_VERSION: $UBUNTU_VERSION
229 debian:stable@container-prep:
231 - .debian@container-build
232 - .pull_upstream_or_rebuild
236 DEBIAN_VERSION: 'stable'
237 DISTRIB_FLAVOR: debian
238 DISTRIB_VERSION: $DEBIAN_VERSION
243 debian:sid@container-prep:
245 - .debian@container-build
246 - .pull_upstream_or_rebuild
250 DEBIAN_VERSION: 'sid'
251 DISTRIB_FLAVOR: debian
252 DISTRIB_VERSION: $DEBIAN_VERSION
257 centos:7@container-prep:
259 - .centos@container-build
260 - .pull_upstream_or_rebuild
265 DISTRIB_FLAVOR: centos
266 DISTRIB_VERSION: $CENTOS_VERSION
271 centos:8@container-prep:
273 - .centos@container-build
274 - .pull_upstream_or_rebuild
279 DISTRIB_FLAVOR: centos
280 DISTRIB_VERSION: $CENTOS_VERSION
285 arch:rolling@container-prep:
287 - .arch@container-build
288 - .pull_upstream_or_rebuild
292 ARCH_VERSION: 'rolling'
293 DISTRIB_FLAVOR: archlinux
294 DISTRIB_VERSION: $ARCH_VERSION
299 alpine:latest@container-prep:
301 - .alpine@container-build
302 - .pull_upstream_or_rebuild
306 ALPINE_VERSION: 'latest'
307 DISTRIB_FLAVOR: alpine
308 DISTRIB_VERSION: $ALPINE_VERSION
312 #################################################################
314 # container clean stage #
315 # run during the clean stage #
317 #################################################################
320 # This stage will look for the container images we currently have in
321 # the registry and will remove any that are not tagged with the provided
322 # $container_image:$tag
325 stage: container_clean
326 image: $BUILDAH_IMAGE
328 # get the full container image name (CURRENT_CONTAINER_IMAGE still has indirections)
329 - CONTAINER_IMAGE=$(eval echo "$CURRENT_CONTAINER_IMAGE")
330 - GITLAB=$(echo $CI_PROJECT_URL | cut -f3 -d/)
331 - REPOSITORY=$(echo $CONTAINER_IMAGE | cut -f2- -d/ | cut -f1 -d:)
332 - IMAGE_PATH=$(echo $CONTAINER_IMAGE | cut -f1 -d:)
333 - LATEST_TAG=$(echo $CONTAINER_IMAGE | cut -f2 -d:)
335 # log in to the registry (read only)
336 - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
338 # get the r/w token from the settings to access the registry
340 # each developer needs to register a secret variable that contains
341 # a personal token with api access. The token
342 # - must be named PERSONAL_TOKEN_$USER (for example PERSONAL_TOKEN_bentiss)
343 # - must be registered in the CI/CD Variables section as type file
344 # - value must be a netrc file as a single-line string:
345 # default login <user> password <token value>
346 # e.g. "default login bentiss password 1235abcde"
347 - tokenname="PERSONAL_TOKEN_$GITLAB_USER_LOGIN"
348 - netrcfile=$(eval echo "\$$tokenname")
349 - if [[ ! -f "$netrcfile" ]]; then
350 echo "No netrc file found or token is missing, skipping job" && false;
353 # request a token for the registry API
354 - REGISTRY_TOKEN=$(curl https://$GITLAB/jwt/auth --get
355 --silent --show-error
357 -d offline_token=true
358 -d service=container_registry
359 -d "scope=repository:$REPOSITORY:pull,*"
361 --netrc-file "$netrcfile"
362 | sed -r 's/(\{"token":"|"\})//g')
364 # get the digest of the latest image
365 - LATEST_MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.Digest')
367 # get the list of tags
368 - TAGS=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.RepoTags[]')
369 # FIXME: is the above command working properly? If not, use below:
370 # - TAGS=$(curl -X GET -H "accept:application/vnd.docker.distribution.manifest.v2+json"
371 # -H "authorization:Bearer $REGISTRY_TOKEN"
372 # https://$CI_REGISTRY/v2/$REPOSITORY/tags/list | jq -r '.tags[]')
374 # iterate over the tags
377 MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:$tag | jq -r '.Digest');
378 if test x"$MANIFEST" != x"$LATEST_MANIFEST";
380 echo removing $tag as $MANIFEST;
381 curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/$MANIFEST --silent
382 -H "accept:application/vnd.docker.distribution.manifest.v2+json"
383 -H "authorization:Bearer $REGISTRY_TOKEN"
384 --fail --show-error -X DELETE || true
394 fedora:30@container-clean:
395 extends: .container-clean
399 CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE
403 fedora:31@container-clean:
404 extends: .container-clean
408 CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE
412 ubuntu:19.10@container-clean:
413 extends: .container-clean
416 UBUNTU_VERSION: '19.10'
417 CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE
421 ubuntu:19.04@container-clean:
422 extends: .container-clean
425 UBUNTU_VERSION: '19.04'
426 CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE
430 debian:stable@container-clean:
431 extends: .container-clean
434 DEBIAN_VERSION: 'stable'
435 CURRENT_CONTAINER_IMAGE: $DEBIAN_CONTAINER_IMAGE
439 debian:sid@container-clean:
440 extends: .container-clean
443 DEBIAN_VERSION: 'sid'
444 CURRENT_CONTAINER_IMAGE: $DEBIAN_CONTAINER_IMAGE
448 centos:7@container-clean:
449 extends: .container-clean
453 CURRENT_CONTAINER_IMAGE: $CENTOS_CONTAINER_IMAGE
457 centos:8@container-clean:
458 extends: .container-clean
462 CURRENT_CONTAINER_IMAGE: $CENTOS_CONTAINER_IMAGE
466 arch:rolling@container-clean:
467 extends: .container-clean
470 ARCH_VERSION: 'rolling'
471 CURRENT_CONTAINER_IMAGE: $ARCH_CONTAINER_IMAGE
475 alpine:latest@container-clean:
476 extends: .container-clean
479 ALPINE_VERSION: 'latest'
480 CURRENT_CONTAINER_IMAGE: $ALPINE_CONTAINER_IMAGE
483 #################################################################
487 #################################################################
489 .autotools-build@template:
495 MAKE_ARGS: "distcheck"
497 .meson-build@template:
506 fedora:30@autotools-build:
507 extends: .autotools-build@template
509 image: $FEDORA_CONTAINER_IMAGE
512 needs: ['fedora:30@container-prep']
514 fedora:30@meson-build:
515 extends: .meson-build@template
517 image: $FEDORA_CONTAINER_IMAGE
520 needs: ['fedora:30@container-prep']
523 fedora:31@autotools-build:
524 extends: .autotools-build@template
526 image: $FEDORA_CONTAINER_IMAGE
529 needs: ['fedora:31@container-prep']
531 fedora:31@meson-build:
532 extends: .meson-build@template
534 image: $FEDORA_CONTAINER_IMAGE
537 needs: ['fedora:31@container-prep']
540 ubuntu:19.10@autotools-build:
541 extends: .autotools-build@template
543 image: $UBUNTU_CONTAINER_IMAGE
545 UBUNTU_VERSION: '19.10'
546 needs: ['ubuntu:19.10@container-prep']
548 ubuntu:19.10@meson-build:
549 extends: .meson-build@template
551 image: $UBUNTU_CONTAINER_IMAGE
553 UBUNTU_VERSION: '19.10'
554 needs: ['ubuntu:19.10@container-prep']
557 ubuntu:19.04@autotools-build:
558 extends: .autotools-build@template
560 image: $UBUNTU_CONTAINER_IMAGE
562 UBUNTU_VERSION: '19.04'
563 needs: ['ubuntu:19.04@container-prep']
565 ubuntu:19.04@meson-build:
566 extends: .meson-build@template
568 image: $UBUNTU_CONTAINER_IMAGE
570 UBUNTU_VERSION: '19.04'
571 needs: ['ubuntu:19.04@container-prep']
574 debian:stable@autotools-build:
575 extends: .autotools-build@template
577 image: $DEBIAN_CONTAINER_IMAGE
579 DEBIAN_VERSION: 'stable'
580 needs: ['debian:stable@container-prep']
582 debian:stable@meson-build:
583 extends: .meson-build@template
585 image: $DEBIAN_CONTAINER_IMAGE
587 DEBIAN_VERSION: 'stable'
588 needs: ['debian:stable@container-prep']
591 debian:sid@autotools-build:
592 extends: .autotools-build@template
594 image: $DEBIAN_CONTAINER_IMAGE
596 DEBIAN_VERSION: 'sid'
597 needs: ['debian:sid@container-prep']
599 debian:sid@meson-build:
600 extends: .meson-build@template
602 image: $DEBIAN_CONTAINER_IMAGE
604 DEBIAN_VERSION: 'sid'
605 needs: ['debian:sid@container-prep']
608 centos:7@autotools-build:
609 extends: .autotools-build@template
611 image: $CENTOS_CONTAINER_IMAGE
614 MAKE_ARGS: '' # disable distcheck, requires doxygen
615 needs: ['centos:7@container-prep']
619 centos:8@autotools-build:
620 extends: .autotools-build@template
622 image: $CENTOS_CONTAINER_IMAGE
625 MAKE_ARGS: '' # disable distcheck, requires doxygen
626 needs: ['centos:8@container-prep']
630 arch:rolling@autotools-build:
631 extends: .autotools-build@template
633 image: $ARCH_CONTAINER_IMAGE
635 ARCH_VERSION: 'rolling'
636 needs: ['arch:rolling@container-prep']
638 arch:rolling@meson-build:
639 extends: .meson-build@template
641 image: $ARCH_CONTAINER_IMAGE
643 ARCH_VERSION: 'rolling'
644 needs: ['arch:rolling@container-prep']
647 alpine:latest@autotools-build:
648 extends: .autotools-build@template
650 image: $ALPINE_CONTAINER_IMAGE
652 ALPINE_VERSION: 'latest'
653 needs: ['alpine:latest@container-prep']
655 alpine:latest@meson-build:
656 extends: .meson-build@template
658 image: $ALPINE_CONTAINER_IMAGE
660 ALPINE_VERSION: 'latest'
661 needs: ['alpine:latest@container-prep']
664 # Build argument tests
666 # We only run the build option combinations on one image
667 # because they're supposed to fail equally on all
668 .fedora-custom-build@autotools-template:
669 extends: .autotools-build@template
671 image: $FEDORA_CONTAINER_IMAGE
674 needs: ['fedora:31@container-prep']
676 fedora:31@no-valgrind-autotools:
677 extends: .fedora-custom-build@autotools-template
679 - dnf remove -y valgrind
681 fedora:31@no-check-autotools:
682 extends: .fedora-custom-build@autotools-template
684 - dnf remove -y check check-devel
686 fedora:31@no-doxygen-autotools:
687 extends: .fedora-custom-build@autotools-template
689 - dnf remove -y doxygen
691 MAKE_ARGS: '' # disable distcheck, requires doxygen
693 # doxygen is required for distcheck
694 fedora:31@no-doxygen-check-valgrind-autotools:
695 extends: .fedora-custom-build@autotools-template
697 - dnf remove -y doxygen valgrind check check-devel
699 MAKE_ARGS: '' # disable distcheck, requires doxygen
701 fedora:31@no-nm-autotools:
702 extends: .fedora-custom-build@autotools-template
704 - mv /usr/bin/nm /usr/bin/nm.moved
706 fedora:31@enable-gcov-autotools:
707 extends: .fedora-custom-build@autotools-template
709 CONFIGURE_FLAGS: "--enable-gcov"