meson.build: use local include path for tests
[platform/upstream/libevdev.git] / .gitlab-ci.yml
index 1ced013..1819aa0 100644 (file)
-# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0:
+########################################
+#                                      #
+# THIS FILE IS GENERATED, DO NOT EDIT  #
+#                                      #
+########################################
 
-.templates_sha: &template_sha 01f2a6a8ab5cd31000c1c14a1acfff68ea98b59e # see https://docs.gitlab.com/ee/ci/yaml/#includefile
+.templates_sha: &template_sha 2469555cd0a6b621b988e100ddd746c2ad0cdd1d # see https://docs.gitlab.com/ee/ci/yaml/#includefile
 
 include:
   # Alpine container builder template
-  - project: 'wayland/ci-templates'
+  - project: 'freedesktop/ci-templates'
+    ref: *template_sha
     file: '/templates/alpine.yml'
   # Arch container builder template
-  - project: 'wayland/ci-templates'
+  - project: 'freedesktop/ci-templates'
     ref: *template_sha
     file: '/templates/arch.yml'
+  # Centos container builder template
+  - project: 'freedesktop/ci-templates'
+    ref: *template_sha
+    file: '/templates/centos.yml'
+  # Debian container builder template
+  - project: 'freedesktop/ci-templates'
+    ref: *template_sha
+    file: '/templates/debian.yml'
   # Fedora container builder template
-  - project: 'wayland/ci-templates'
+  - project: 'freedesktop/ci-templates'
     ref: *template_sha
     file: '/templates/fedora.yml'
   # Ubuntu container builder template
-  - project: 'wayland/ci-templates'
+  - project: 'freedesktop/ci-templates'
     ref: *template_sha
     file: '/templates/ubuntu.yml'
-  # Debian container builder template
-  - project: 'wayland/ci-templates'
-    ref: *template_sha
-    file: '/templates/debian.yml'
-  # CentOS container builder template
-  - project: 'wayland/ci-templates'
-    ref: *template_sha
-    file: '/templates/centos.yml'
 
 stages:
-  - container_prep   # rebuild the container images if there is a change
+  - prep             # rebuild the container images if there is a change
   - build            # for actually building and testing things in a container
   - VM               # for running the test suite in a VM
-  - distro           # distribs test
-  - deploy           # trigger wayland's website generation
+  - autotools        # distribution builds with autotools
+  - meson            # distribution builds with meson
+  - tarballs         # tarball builds
   - container_clean  # clean up unused container images
 
 variables:
-  ###############################################################################
-  # This is the list of packages required to build libevdev with the default    #
-  # configuration.                                                              #
-  #                                                                             #
-  # Run dnf install/apt-get install/.. with the list of packages for your       #
-  # distribution                                                                #
-  ###############################################################################
-  FEDORA_RPMS: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig  python3 check-devel valgrind binutils doxygen xz'
-  CENTOS_RPMS: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig  python3 check-devel valgrind binutils xz'
-  UBUNTU_DEBS: 'git gcc g++     automake autoconf libtool make pkg-config python3 check       valgrind binutils doxygen xz-utils'
-  DEBIAN_DEBS: $UBUNTU_DEBS
-  ARCH_PKGS:   'git gcc         automake autoconf libtool make pkgconfig  python3 check       valgrind binutils doxygen'
-  ALPINE_PKGS: 'git gcc g++     automake autoconf libtool make pkgconfig  python3 check-dev   valgrind binutils doxygen xz linux-headers'
-  ############################ end of package lists #############################
-  # these tags should be updated each time the list of packages is updated
-  # changing these will force rebuilding the associated image
-  # Note: these tags have no meaning and are not tied to a particular
-  # libevdev version
-  FEDORA_TAG: '2019-10-24.0'
-  CENTOS_TAG: '2019-10-24.0'
-  DEBIAN_TAG: '2019-10-24.0'
-  UBUNTU_TAG: '2019-10-24.0'
-  ARCH_TAG: '2019-10-24.0'
-  ALPINE_TAG: '2019-10-24.0'
-
-  UPSTREAM_REPO: libevdev/libevdev
-  BUILDAH_IMAGE: $CI_REGISTRY/wayland/ci-templates/buildah:latest
-  FEDORA_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FEDORA_VERSION:$FEDORA_TAG
-  CENTOS_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/centos/$CENTOS_VERSION:$CENTOS_TAG
-  UBUNTU_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$UBUNTU_VERSION:$UBUNTU_TAG
-  DEBIAN_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG
-  ARCH_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/archlinux/rolling:$ARCH_TAG
-  ALPINE_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/alpine/latest:$ALPINE_TAG
-
+  # The upstrem repository we will check for images
+  FDO_UPSTREAM_REPO: libevdev/libevdev
   LIBEVDEV_SKIP_ROOT_TESTS: 1
   GIT_DEPTH: 1
+  MESON_BUILDDIR: 'build dir'
 
-.default_artifacts: &default_artifacts
+.default_artifacts:
   artifacts:
     paths:
-      - test/test-suite.log
+      - _build/test/test-suite.log
+      - $MESON_BUILDDIR/meson-logs/
     expire_in: 1 week
     when: on_failure
+    reports:
+      junit: $MESON_BUILDDIR/junit-*.xml
 
-.default_build: &default_build
+.autotools_build:
+  extends:
+    - .default_artifacts
   script:
-    - autoreconf -ivf
-    - ./configure --disable-silent-rules $CONFIGURE_FLAGS
+    - mkdir _build
+    - pushd _build > /dev/null
+    - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
     - make
     - make check
     - if ! [[ -z "$MAKE_ARGS" ]]; then make $MAKE_ARGS; fi
-  <<: *default_artifacts
+    - popd > /dev/null
+
+.meson_build:
+  extends:
+    - .default_artifacts
+  script:
+    - .gitlab-ci/meson-build.sh
+
+.fedora:30:
+  extends: .fdo.distribution_image@fedora
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: '30'
+
+.fedora:31:
+  extends: .fdo.distribution_image@fedora
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: '31'
+
+.ubuntu:19.10:
+  extends: .fdo.distribution_image@ubuntu
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: '19.10'
+
+.ubuntu:19.04:
+  extends: .fdo.distribution_image@ubuntu
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: '19.04'
+
+.debian:stable:
+  extends: .fdo.distribution_image@debian
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: 'stable'
+
+.debian:sid:
+  extends: .fdo.distribution_image@debian
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: 'sid'
+
+.centos:7:
+  extends: .fdo.distribution_image@centos
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: '7'
+
+.centos:8:
+  extends: .fdo.distribution_image@centos
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: '8'
+
+.arch:rolling:
+  extends: .fdo.distribution_image@arch
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: 'rolling'
+
+.alpine:latest:
+  extends: .fdo.distribution_image@alpine
+  variables:
+    FDO_DISTRIBUTION_TAG: '2020-03-13.0'
+    FDO_DISTRIBUTION_VERSION: 'latest'
+
+
 
 #################################################################
 #                                                               #
-#                    container prep stage                       #
+#                          prep stage                           #
 #                                                               #
 #################################################################
 
-.pull_upstream_or_rebuild: &pull_upstream_or_rebuild
+# Re-generate the CI script and make sure it's the one currently checked in
+# If this job fails, re-generate the gitlab-ci.yml script, see
+# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
+#
+check-ci-script:
+  image: golang:alpine
+  stage: prep
+  before_script:
+    - apk add python3 git
+    - pip3 install --user jinja2 PyYAML
+  script:
+    - python3 ./.gitlab-ci/generate-gitlab-ci.py
+    - git diff --exit-code && exit 0 || true
+    - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
+    - exit 1
+
+check-commit:
+  image: golang:alpine
+  stage: prep
   before_script:
-    # log in to the registry
-    - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
+    - apk add python3 git
+  script:
+    - pip3 install GitPython
+    - pip3 install pytest
+    - |
+      pytest --junitxml=results.xml \
+             --tb=line \
+             --assert=plain \
+             ./.gitlab-ci/check-commit.py
+  except:
+    - master@libevdev/libevdev
+  variables:
+    GIT_DEPTH: 100
+  artifacts:
+    expire_in: 1 week
+    when: on_failure
+    paths:
+      - results.xml
+    reports:
+      junit: results.xml
 
-    # get the full container image name (DISTRIB_VERSION still has indirections)
-    - IMAGE=$(eval echo "$DISTRIB_FLAVOR/$DISTRIB_VERSION:$TAG")
+.fedora.packages:
+  variables:
+    FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ meson automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils doxygen xz clang-analyzer'
 
-    - |
-      # force rebuild if schedule, reuse otherwise
-      if [[ $CI_PIPELINE_SOURCE != "schedule" ]] ;
-      then
-        # pull the latest upstream image if it exists
-        skopeo copy docker://$CI_REGISTRY/$UPSTREAM_REPO/$IMAGE \
-                    docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
+.ubuntu.packages:
+  variables:
+    FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
 
-        # check if our image is already in the current registry
-        skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
-      fi
+.debian.packages:
+  variables:
+    FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkg-config python3 check valgrind binutils doxygen xz-utils'
+
+.centos.packages:
+  variables:
+    FDO_DISTRIBUTION_PACKAGES: 'git gcc gcc-c++ automake autoconf libtool make pkgconfig python3 check-devel valgrind binutils xz'
+
+.arch.packages:
+  variables:
+    FDO_DISTRIBUTION_PACKAGES: 'git gcc meson automake autoconf libtool make pkgconfig python3 check valgrind binutils doxygen'
+
+.alpine.packages:
+  variables:
+    FDO_DISTRIBUTION_PACKAGES: 'git gcc g++ meson automake autoconf libtool make pkgconfig python3 check-dev valgrind binutils doxygen xz linux-headers'
+
+
+# Pulls in the qemu container from upstream or rebuilds it if missing
+.fedora:30@qemu-prep:
+  extends:
+    - .fedora:30
+    - .fedora.packages
+    - .fdo.qemu-ifnot-exists@fedora
+  stage: prep
+  tags:
+    - kvm
+  variables:
+    GIT_STRATEGY: none
+    FDO_DISTRIBUTION_TAG: qemu-2020-03-13.0
+  allow_failure: true
+
+# Always rebuilds the container
+.fedora:30@qemu-forced-rebuild:
+  extends:
+    - .fedora:30
+    - .fedora.packages
+    - .fdo.qemu-ifnot-exists@fedora
+  stage: prep
+  tags:
+    - kvm
+  variables:
+    GIT_STRATEGY: none
+    FDO_DISTRIBUTION_TAG: qemu-2020-03-13.0
+  allow_failure: true
+  only:
+    - schedules
 
+# Pulls in the qemu container from upstream or rebuilds it if missing
+.fedora:31@qemu-prep:
+  extends:
+    - .fedora:31
+    - .fedora.packages
+    - .fdo.qemu-ifnot-exists@fedora
+  stage: prep
+  tags:
+    - kvm
+  variables:
+    GIT_STRATEGY: none
+    FDO_DISTRIBUTION_TAG: qemu-2020-03-13.0
+  allow_failure: true
+
+# Always rebuilds the container
+.fedora:31@qemu-forced-rebuild:
+  extends:
+    - .fedora:31
+    - .fedora.packages
+    - .fdo.qemu-ifnot-exists@fedora
+  stage: prep
+  tags:
+    - kvm
+  variables:
+    GIT_STRATEGY: none
+    FDO_DISTRIBUTION_TAG: qemu-2020-03-13.0
+  allow_failure: true
+  only:
+    - schedules
+
+
+# This is the actual job
+fedora:31@qemu-prep:
+  extends: .fedora:31@qemu-prep
+
+fedora:31@qemu-forced-rebuild:
+  extends: .fedora:31@qemu-forced-rebuild
+
+
+# Pulls in the container from upstream or rebuilds it if missing
 fedora:30@container-prep:
-  extends: .fedora@container-build
-  stage: container_prep
+  extends:
+    - .fedora:30
+    - .fedora.packages
+    - .fdo.container-ifnot-exists@fedora
+  stage: prep
+  variables:
+    GIT_STRATEGY: none
+
+# Always rebuilds the container
+fedora:30@container-forced-rebuild:
+  extends:
+    - .fedora:30
+    - .fedora.packages
+    - .fdo.container-build@fedora
+  stage: prep
+  only:
+    - schedules
   variables:
     GIT_STRATEGY: none
-    FEDORA_VERSION: 30
-    DISTRIB_FLAVOR: fedora
-    DISTRIB_VERSION: $FEDORA_VERSION
-    TAG: $FEDORA_TAG
-  <<: *pull_upstream_or_rebuild
 
+
+# Pulls in the container from upstream or rebuilds it if missing
 fedora:31@container-prep:
-  extends: .fedora@container-build
-  stage: container_prep
+  extends:
+    - .fedora:31
+    - .fedora.packages
+    - .fdo.container-ifnot-exists@fedora
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    FEDORA_VERSION: 31
-    DISTRIB_FLAVOR: fedora
-    DISTRIB_VERSION: $FEDORA_VERSION
-    TAG: $FEDORA_TAG
-  <<: *pull_upstream_or_rebuild
 
+# Always rebuilds the container
+fedora:31@container-forced-rebuild:
+  extends:
+    - .fedora:31
+    - .fedora.packages
+    - .fdo.container-build@fedora
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
 
+
+# Pulls in the container from upstream or rebuilds it if missing
 ubuntu:19.10@container-prep:
-  extends: .ubuntu@container-build
-  stage: container_prep
+  extends:
+    - .ubuntu:19.10
+    - .ubuntu.packages
+    - .fdo.container-ifnot-exists@ubuntu
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    UBUNTU_VERSION: "19.10"
-    DISTRIB_FLAVOR: ubuntu
-    DISTRIB_VERSION: $UBUNTU_VERSION
-    TAG: $UBUNTU_TAG
-  <<: *pull_upstream_or_rebuild
 
+# Always rebuilds the container
+ubuntu:19.10@container-forced-rebuild:
+  extends:
+    - .ubuntu:19.10
+    - .ubuntu.packages
+    - .fdo.container-build@ubuntu
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
+
+
+# Pulls in the container from upstream or rebuilds it if missing
 ubuntu:19.04@container-prep:
-  extends: .ubuntu@container-build
-  stage: container_prep
+  extends:
+    - .ubuntu:19.04
+    - .ubuntu.packages
+    - .fdo.container-ifnot-exists@ubuntu
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    UBUNTU_VERSION: "19.04"
-    DISTRIB_FLAVOR: ubuntu
-    DISTRIB_VERSION: $UBUNTU_VERSION
-    TAG: $UBUNTU_TAG
-  <<: *pull_upstream_or_rebuild
 
+# Always rebuilds the container
+ubuntu:19.04@container-forced-rebuild:
+  extends:
+    - .ubuntu:19.04
+    - .ubuntu.packages
+    - .fdo.container-build@ubuntu
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
+
+
+# Pulls in the container from upstream or rebuilds it if missing
 debian:stable@container-prep:
-  extends: .debian@container-build
-  stage: container_prep
+  extends:
+    - .debian:stable
+    - .debian.packages
+    - .fdo.container-ifnot-exists@debian
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    DEBIAN_VERSION: stable
-    DISTRIB_FLAVOR: debian
-    DISTRIB_VERSION: $DEBIAN_VERSION
-    TAG: $DEBIAN_TAG
-  <<: *pull_upstream_or_rebuild
 
+# Always rebuilds the container
+debian:stable@container-forced-rebuild:
+  extends:
+    - .debian:stable
+    - .debian.packages
+    - .fdo.container-build@debian
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
+
+
+# Pulls in the container from upstream or rebuilds it if missing
 debian:sid@container-prep:
-  extends: .debian@container-build
-  stage: container_prep
+  extends:
+    - .debian:sid
+    - .debian.packages
+    - .fdo.container-ifnot-exists@debian
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    DEBIAN_VERSION: sid
-    DISTRIB_FLAVOR: debian
-    DISTRIB_VERSION: $DEBIAN_VERSION
-    TAG: $DEBIAN_TAG
-  <<: *pull_upstream_or_rebuild
 
+# Always rebuilds the container
+debian:sid@container-forced-rebuild:
+  extends:
+    - .debian:sid
+    - .debian.packages
+    - .fdo.container-build@debian
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
+
+
+# Pulls in the container from upstream or rebuilds it if missing
 centos:7@container-prep:
-  extends: .centos@container-build
-  stage: container_prep
+  extends:
+    - .centos:7
+    - .centos.packages
+    - .fdo.container-ifnot-exists@centos
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    CENTOS_VERSION: 7
-    DISTRIB_FLAVOR: centos
-    DISTRIB_VERSION: $CENTOS_VERSION
-    TAG: $CENTOS_TAG
-  <<: *pull_upstream_or_rebuild
 
+# Always rebuilds the container
+centos:7@container-forced-rebuild:
+  extends:
+    - .centos:7
+    - .centos.packages
+    - .fdo.container-build@centos
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
+
+
+# Pulls in the container from upstream or rebuilds it if missing
 centos:8@container-prep:
-  extends: .centos@container-build
-  stage: container_prep
+  extends:
+    - .centos:8
+    - .centos.packages
+    - .fdo.container-ifnot-exists@centos
+  stage: prep
+  variables:
+    GIT_STRATEGY: none
+
+# Always rebuilds the container
+centos:8@container-forced-rebuild:
+  extends:
+    - .centos:8
+    - .centos.packages
+    - .fdo.container-build@centos
+  stage: prep
+  only:
+    - schedules
   variables:
     GIT_STRATEGY: none
-    CENTOS_VERSION: 8
-    DISTRIB_FLAVOR: centos
-    DISTRIB_VERSION: $CENTOS_VERSION
-    TAG: $CENTOS_TAG
-  <<: *pull_upstream_or_rebuild
 
+
+# Pulls in the container from upstream or rebuilds it if missing
 arch:rolling@container-prep:
-  extends: .arch@container-build
-  stage: container_prep
+  extends:
+    - .arch:rolling
+    - .arch.packages
+    - .fdo.container-ifnot-exists@arch
+  stage: prep
+  variables:
+    GIT_STRATEGY: none
+
+# Always rebuilds the container
+arch:rolling@container-forced-rebuild:
+  extends:
+    - .arch:rolling
+    - .arch.packages
+    - .fdo.container-build@arch
+  stage: prep
+  only:
+    - schedules
   variables:
     GIT_STRATEGY: none
-    ARCH_VERSION: rolling
-    DISTRIB_FLAVOR: archlinux
-    DISTRIB_VERSION: $ARCH_VERSION
-    TAG: $ARCH_TAG
-  <<: *pull_upstream_or_rebuild
 
+
+# Pulls in the container from upstream or rebuilds it if missing
 alpine:latest@container-prep:
-  extends: .alpine@container-build
-  stage: container_prep
+  extends:
+    - .alpine:latest
+    - .alpine.packages
+    - .fdo.container-ifnot-exists@alpine
+  stage: prep
   variables:
     GIT_STRATEGY: none
-    ALPINE_VERSION: latest
-    DISTRIB_FLAVOR: alpine
-    DISTRIB_VERSION: $ALPINE_VERSION
-    TAG: $ALPINE_TAG
-  <<: *pull_upstream_or_rebuild
+
+# Always rebuilds the container
+alpine:latest@container-forced-rebuild:
+  extends:
+    - .alpine:latest
+    - .alpine.packages
+    - .fdo.container-build@alpine
+  stage: prep
+  only:
+    - schedules
+  variables:
+    GIT_STRATEGY: none
+
 
 #################################################################
 #                                                               #
@@ -237,142 +520,97 @@ alpine:latest@container-prep:
 # This stage will look for the container images we currently have in
 # the registry and will remove any that are not tagged with the provided
 # $container_image:$tag
-#
 .container-clean:
   stage: container_clean
-  image: $BUILDAH_IMAGE
+  image: golang:alpine
+  before_script:
+    - apk add python3
+    - pip3 install --user python-gitlab
   script:
-    # get the full container image name (CURRENT_CONTAINER_IMAGE still has indirections)
-    - CONTAINER_IMAGE=$(eval echo "$CURRENT_CONTAINER_IMAGE")
-    - GITLAB=$(echo $CI_PROJECT_URL | cut -f3 -d/)
-    - REPOSITORY=$(echo $CONTAINER_IMAGE | cut -f2- -d/ | cut -f1 -d:)
-    - IMAGE_PATH=$(echo $CONTAINER_IMAGE | cut -f1 -d:)
-    - LATEST_TAG=$(echo $CONTAINER_IMAGE | cut -f2 -d:)
-
-    # log in to the registry (read only)
-    - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
-
-    # get the r/w token from the settings to access the registry
-    #
-    # each developer needs to register a secret variable that contains
-    # a personal token with api access. The token
-    # - must be named PERSONAL_TOKEN_$USER (for example PERSONAL_TOKEN_bentiss)
-    # - must be registered in the CI/CD Variables section as type file
-    # - value must be a netrc file as a single-line string:
-    #   default login <user> password <token value>
-    #   e.g. "default login bentiss password 1235abcde"
-    - tokenname="PERSONAL_TOKEN_$GITLAB_USER_LOGIN"
-    - netrcfile=$(eval echo "\$$tokenname")
-    - if [[ ! -f "$netrcfile" ]]; then
-         echo "No netrc file found or token is missing, skipping job" && false;
-      fi
-
-    # request a token for the registry API
-    - REGISTRY_TOKEN=$(curl https://$GITLAB/jwt/auth --get
-                             --silent --show-error
-                             -d client_id=docker
-                             -d offline_token=true
-                             -d service=container_registry
-                             -d "scope=repository:$REPOSITORY:pull,*"
-                             --fail
-                             --netrc-file "$netrcfile"
-                             | sed -r 's/(\{"token":"|"\})//g')
-
-    # get the digest of the latest image
-    - LATEST_MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.Digest')
-
-    # get the list of tags
-    - TAGS=$(skopeo inspect docker://$IMAGE_PATH:$LATEST_TAG | jq -r '.RepoTags[]')
-    # FIXME: is the above command working properly? If not, use below:
-    # - TAGS=$(curl -X GET -H "accept:application/vnd.docker.distribution.manifest.v2+json"
-    #                      -H "authorization:Bearer $REGISTRY_TOKEN"
-    #                      https://$CI_REGISTRY/v2/$REPOSITORY/tags/list | jq -r '.tags[]')
-
-    # iterate over the tags
-    - for tag in $TAGS;
-      do
-        MANIFEST=$(skopeo inspect docker://$IMAGE_PATH:$tag | jq -r '.Digest');
-        if test x"$MANIFEST" != x"$LATEST_MANIFEST";
-          then
-            echo removing $tag as $MANIFEST;
-            curl https://$CI_REGISTRY/v2/$REPOSITORY/manifests/$MANIFEST --silent
-                 -H "accept:application/vnd.docker.distribution.manifest.v2+json"
-                 -H "authorization:Bearer $REGISTRY_TOKEN"
-                 --fail --show-error -X DELETE || true
-          ;fi
-      ;done
+    - LATEST_TAG=$(echo $DISTRO_CONTAINER_IMAGE | cut -f2 -d:)
+    # Go to your Profile, Settings, Access Tokens
+    # Create a personal token with 'api' scope, copy the value.
+    # Go to Settings, CI/CD, Variables
+    # Define a variable of type File named AUTHFILE. Content is that token
+    # value.
+    - python3 .gitlab-ci/gitlab-container-delete $CI_SERVER_URL $CI_PROJECT_PATH
+            --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
+            --authfile $AUTHFILE --exclude-tag "$LATEST_TAG"
   dependencies: []
   allow_failure: true
   only:
     - schedules
 
+### fedora 30
 fedora:30@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    FEDORA_VERSION: 30
-    CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE
+  extends:
+    - .fedora:30
+    - .container-clean
+  needs: ["fedora:30@container-prep"]
 
+### fedora 31
 fedora:31@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    FEDORA_VERSION: 31
-    CURRENT_CONTAINER_IMAGE: $FEDORA_CONTAINER_IMAGE
+  extends:
+    - .fedora:31
+    - .container-clean
+  needs: ["fedora:31@container-prep"]
 
+### ubuntu 19.10
 ubuntu:19.10@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    UBUNTU_VERSION: "19.10"
-    CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE
+  extends:
+    - .ubuntu:19.10
+    - .container-clean
+  needs: ["ubuntu:19.10@container-prep"]
 
+### ubuntu 19.04
 ubuntu:19.04@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    UBUNTU_VERSION: "19.04"
-    CURRENT_CONTAINER_IMAGE: $UBUNTU_CONTAINER_IMAGE
+  extends:
+    - .ubuntu:19.04
+    - .container-clean
+  needs: ["ubuntu:19.04@container-prep"]
 
+### debian stable
 debian:stable@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    DEBIAN_VERSION: stable
-    CURRENT_CONTAINER_IMAGE: $DEBIAN_CONTAINER_IMAGE
+  extends:
+    - .debian:stable
+    - .container-clean
+  needs: ["debian:stable@container-prep"]
 
+### debian sid
 debian:sid@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    DEBIAN_VERSION: sid
-    CURRENT_CONTAINER_IMAGE: $DEBIAN_CONTAINER_IMAGE
+  extends:
+    - .debian:sid
+    - .container-clean
+  needs: ["debian:sid@container-prep"]
 
+### centos 7
 centos:7@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    CENTOS_VERSION: 7
-    CURRENT_CONTAINER_IMAGE: $CENTOS_CONTAINER_IMAGE
+  extends:
+    - .centos:7
+    - .container-clean
+  needs: ["centos:7@container-prep"]
 
+### centos 8
 centos:8@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    CENTOS_VERSION: 8
-    CURRENT_CONTAINER_IMAGE: $CENTOS_CONTAINER_IMAGE
+  extends:
+    - .centos:8
+    - .container-clean
+  needs: ["centos:8@container-prep"]
 
+### arch rolling
 arch:rolling@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    CURRENT_CONTAINER_IMAGE: $ARCH_CONTAINER_IMAGE
+  extends:
+    - .arch:rolling
+    - .container-clean
+  needs: ["arch:rolling@container-prep"]
 
+### alpine latest
 alpine:latest@container-clean:
-  extends: .container-clean
-  variables:
-    GIT_STRATEGY: none
-    CURRENT_CONTAINER_IMAGE: $ALPINE_CONTAINER_IMAGE
+  extends:
+    - .alpine:latest
+    - .container-clean
+  needs: ["alpine:latest@container-prep"]
+
 
 #################################################################
 #                                                               #
@@ -380,148 +618,394 @@ alpine:latest@container-clean:
 #                                                               #
 #################################################################
 
-.build@template:
+.autotools-build@template:
+  extends:
+    - .autotools_build
   stage: build
-  <<: *default_artifacts
-  <<: *default_build
   dependencies: []
   variables:
     MAKE_ARGS: "distcheck"
 
-.fedora-build@template:
-  stage: distro
-  extends: .build@template
-  image: $FEDORA_CONTAINER_IMAGE
-
-fedora:31@default-build:
-  stage: distro
-  extends: .fedora-build@template
+.meson-build@template:
+  extends:
+    - .meson_build
+  stage: build
+  dependencies: []
   variables:
-    FEDORA_VERSION: 31
-  needs: ['fedora:31@container-prep']
+    NINJA_ARGS: "dist"
 
-fedora:30@default-build:
-  stage: distro
-  extends: .fedora-build@template
-  variables:
-    FEDORA_VERSION: 30
+
+fedora:30@autotools-build:
+  extends:
+    - .fedora:30
+    - .autotools-build@template
+  stage: autotools
   needs: ['fedora:30@container-prep']
 
-.centos-build@template:
-  stage: distro
-  extends: .build@template
-  image: $CENTOS_CONTAINER_IMAGE
+fedora:30@meson-build:
+  extends:
+    - .fedora:30
+    - .meson-build@template
+  stage: meson
+  needs: ['fedora:30@container-prep']
 
-centos:7@default-build:
-  extends: .centos-build@template
-  variables:
-    CENTOS_VERSION: 7
-  needs: ['centos:7@container-prep']
 
-centos:8@default-build:
-  extends: .centos-build@template
-  variables:
-    CENTOS_VERSION: 8
-    MAKE_ARGS: ''  # disable distcheck, requires doxygen
-  needs: ['centos:8@container-prep']
+fedora:31@autotools-build:
+  extends:
+    - .fedora:31
+    - .autotools-build@template
+  stage: autotools
+  needs: ['fedora:31@container-prep']
+
+fedora:31@meson-build:
+  extends:
+    - .fedora:31
+    - .meson-build@template
+  stage: meson
+  needs: ['fedora:31@container-prep']
 
-.ubuntu@template:
-  stage: distro
-  extends: .build@template
-  image: $UBUNTU_CONTAINER_IMAGE
 
-ubuntu:19.10@default-build:
-  extends: .ubuntu@template
-  variables:
-    UBUNTU_VERSION: "19.10"
+ubuntu:19.10@autotools-build:
+  extends:
+    - .ubuntu:19.10
+    - .autotools-build@template
+  stage: autotools
   needs: ['ubuntu:19.10@container-prep']
 
-ubuntu:19.04@default-build:
-  extends: .ubuntu@template
-  variables:
-    UBUNTU_VERSION: "19.04"
+ubuntu:19.10@meson-build:
+  extends:
+    - .ubuntu:19.10
+    - .meson-build@template
+  stage: meson
+  needs: ['ubuntu:19.10@container-prep']
+
+
+ubuntu:19.04@autotools-build:
+  extends:
+    - .ubuntu:19.04
+    - .autotools-build@template
+  stage: autotools
   needs: ['ubuntu:19.04@container-prep']
 
-.debian@template:
-  stage: distro
-  extends: .build@template
-  image: $DEBIAN_CONTAINER_IMAGE
+ubuntu:19.04@meson-build:
+  extends:
+    - .ubuntu:19.04
+    - .meson-build@template
+  stage: meson
+  needs: ['ubuntu:19.04@container-prep']
 
-debian:stable@default-build:
-  extends: .debian@template
-  variables:
-    DEBIAN_VERSION: stable
+
+debian:stable@autotools-build:
+  extends:
+    - .debian:stable
+    - .autotools-build@template
+  stage: autotools
   needs: ['debian:stable@container-prep']
 
-debian:sid@default-build:
-  extends: .debian@template
-  variables:
-    DEBIAN_VERSION: sid
+debian:stable@meson-build:
+  extends:
+    - .debian:stable
+    - .meson-build@template
+  stage: meson
+  needs: ['debian:stable@container-prep']
+
+
+debian:sid@autotools-build:
+  extends:
+    - .debian:sid
+    - .autotools-build@template
+  stage: autotools
+  needs: ['debian:sid@container-prep']
+
+debian:sid@meson-build:
+  extends:
+    - .debian:sid
+    - .meson-build@template
+  stage: meson
   needs: ['debian:sid@container-prep']
 
-.arch@template:
-  stage: distro
-  extends: .build@template
-  image: $ARCH_CONTAINER_IMAGE
 
-arch:rolling@default-build:
-  extends: .arch@template
+centos:7@autotools-build:
+  extends:
+    - .centos:7
+    - .autotools-build@template
+  stage: autotools
+  variables:
+    MAKE_ARGS: ''  # disable distcheck, requires doxygen
+  needs: ['centos:7@container-prep']
+
+
+
+centos:8@autotools-build:
+  extends:
+    - .centos:8
+    - .autotools-build@template
+  stage: autotools
+  variables:
+    MAKE_ARGS: ''  # disable distcheck, requires doxygen
+  needs: ['centos:8@container-prep']
+
+
+
+arch:rolling@autotools-build:
+  extends:
+    - .arch:rolling
+    - .autotools-build@template
+  stage: autotools
   needs: ['arch:rolling@container-prep']
 
-.alpine@template:
-  stage: distro
-  extends: .build@template
-  image: $ALPINE_CONTAINER_IMAGE
+arch:rolling@meson-build:
+  extends:
+    - .arch:rolling
+    - .meson-build@template
+  stage: meson
+  needs: ['arch:rolling@container-prep']
+
+
+alpine:latest@autotools-build:
+  extends:
+    - .alpine:latest
+    - .autotools-build@template
+  stage: autotools
+  needs: ['alpine:latest@container-prep']
 
-alpine:latest@default-build:
-  extends: .alpine@template
+alpine:latest@meson-build:
+  extends:
+    - .alpine:latest
+    - .meson-build@template
+  stage: meson
   needs: ['alpine:latest@container-prep']
 
+
 # Build argument tests
 #
 # We only run the build option combinations on one image
 # because they're supposed to fail equally on all
-.fedora-custom-build@template:
+.fedora-custom-build@autotools-template:
+  extends:
+    - .fedora:31
+    - .autotools-build@template
   stage: build
-  extends: .fedora-build@template
-  variables:
-    FEDORA_VERSION: 31
   needs: ['fedora:31@container-prep']
 
-fedora:31@no-valgrind:
-  extends: .fedora-custom-build@template
+no-valgrind:autotools:
+  extends: .fedora-custom-build@autotools-template
   before_script:
     - dnf remove -y valgrind
 
-fedora:31@no-check:
-  extends: .fedora-custom-build@template
+no-check:autotools:
+  extends: .fedora-custom-build@autotools-template
   before_script:
     - dnf remove -y check check-devel
 
-fedora:31@no-doxygen:
-  extends: .fedora-custom-build@template
+no-doxygen:autotools:
+  extends: .fedora-custom-build@autotools-template
   before_script:
     - dnf remove -y doxygen
-  <<: *default_build
   variables:
     MAKE_ARGS: ''  # disable distcheck, requires doxygen
 
 # doxygen is required for distcheck
-fedora:31@no-doxygen-check-valgrind:
-  extends: .fedora-custom-build@template
+no-doxygen-check-valgrind:autotools:
+  extends: .fedora-custom-build@autotools-template
   before_script:
     - dnf remove -y doxygen valgrind check check-devel
-  <<: *default_build
   variables:
     MAKE_ARGS: ''  # disable distcheck, requires doxygen
 
-fedora:31@no-nm:
-  extends: .fedora-custom-build@template
+no-nm:autotools:
+  extends: .fedora-custom-build@autotools-template
   before_script:
     - mv /usr/bin/nm /usr/bin/nm.moved
 
-fedora:31@enable-gcov:
-  extends: .fedora-custom-build@template
-  <<: *default_artifacts
+enable-gcov:autotools:
+  extends: .fedora-custom-build@autotools-template
   variables:
     CONFIGURE_FLAGS: "--enable-gcov"
+
+.fedora-custom-build@meson-template:
+  extends:
+    - .fedora:31
+    - .meson-build@template
+  stage: build
+  needs: ['fedora:31@container-prep']
+
+no-valgrind:meson:
+  extends: .fedora-custom-build@meson-template
+  before_script:
+    - dnf remove -y valgrind
+
+no-check:meson:
+  extends: .fedora-custom-build@meson-template
+  before_script:
+    - dnf remove -y check check-devel
+  variables:
+    MESON_ARGS: -Dtests=disabled
+    SKIP_MESON_TEST: 1
+
+# doxygen is required for dist
+no-doxygen:meson:
+  extends: .fedora-custom-build@meson-template
+  before_script:
+    - dnf remove -y doxygen
+  variables:
+    MESON_ARGS: -Ddocumentation=disabled
+    NINJA_ARGS: ''
+
+# doxygen is required for dist
+no-doxygen-check-valgrind:meson:
+  extends: .fedora-custom-build@meson-template
+  before_script:
+    - dnf remove -y doxygen valgrind check check-devel
+  variables:
+    MESON_ARGS: -Dtests=disabled -Ddocumentation=disabled
+    NINJA_ARGS: ''
+    SKIP_MESON_TEST: 1
+
+enable-gcov:meson:
+  extends: .fedora-custom-build@meson-template
+  variables:
+    MESON_ARGS: '-Dcoverity=true'
+
+scan-build:meson:
+  extends: .fedora-custom-build@meson-template
+  variables:
+    NINJA_ARGS: 'scan-build'
+    SKIP_MESON_TEST: 1
+
+static-build:meson:
+  extends: .fedora-custom-build@meson-template
+  script:
+    - meson "$MESON_BUILDDIR" --default-library=static --prefix=$PWD/prefix-meson/
+    - ninja -C "$MESON_BUILDDIR" install
+    - ls -l $PWD/prefix-meson/lib64/libevdev.a
+
+soname:
+  extends:
+    - .fedora:31
+  stage: build
+  script:
+  - ./autogen.sh --prefix=$PWD/prefix-autotools/
+  - make install
+  - ls -l $PWD/prefix-autotools/lib/libevdev.so.2.3.0
+  - meson "$MESON_BUILDDIR" --prefix=$PWD/prefix-meson/
+  - ninja -C "$MESON_BUILDDIR" install
+  - ls -l $PWD/prefix-meson/lib64/libevdev.so.2.3.0
+  needs: ['fedora:31@container-prep']
+
+#################################################################
+#                                                               #
+#                          VM stage                             #
+#                                                               #
+#################################################################
+
+.check_tainted: &check_tainted |
+  # make sure the kernel is not tainted
+  if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
+  then
+    echo tainted kernel ;
+    exit 1 ;
+  fi
+
+.qemu@fedora:31:
+  extends:
+    - .fedora:31
+  stage: VM
+  image: $CI_REGISTRY_IMAGE/$FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION:qemu-$FDO_DISTRIBUTION_TAG
+  tags:
+    - kvm
+  variables:
+    MESON_BUILDDIR: build_dir
+  script:
+    # start our vm, no args required
+    - /app/start_vm.sh
+
+    - *check_tainted
+
+    - "scp -P 5555 -r $PWD localhost:"
+    - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
+    - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
+    - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
+    - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
+    - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
+    - "scp -P 5555 sshenv localhost:~/$CI_PROJECT_NAME/.meson_environment"
+    - ssh localhost -p 5555 "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
+    # no matter the results of the tests, we want to fetch the logs
+    - scp -P 5555 -r localhost:$CI_PROJECT_NAME/"$MESON_BUILDDIR" .
+
+    - *check_tainted
+
+    - ssh localhost -p 5555 halt || true
+    - sleep 2
+    - pkill qemu || true
+
+    - if [[ ! -e .success ]] ;
+      then
+        exit 1 ;
+      fi
+  artifacts:
+    name: "qemu-meson-logs-$CI_JOB_NAME"
+    when: always
+    expire_in: 1 week
+    paths:
+      - $MESON_BUILDDIR/meson-logs
+      - console.out
+    reports:
+      junit: $MESON_BUILDDIR/junit-*.xml
+
+  retry:
+    max: 2
+    when: script_failure
+  needs: ['fedora:31@qemu-prep']
+
+qemu:meson:
+  extends: .qemu@fedora:31
+
+qemu:meson:valgrind:
+  extends: .qemu@fedora:31
+  variables:
+    MESON_TEST_ARGS: '--setup=valgrind'
+
+meson-from-tarball:
+  extends:
+    - .fedora:31
+  stage: tarballs
+  script:
+    - export INSTALLDIR="$PWD/_inst"
+    - mkdir _build
+    - pushd _build > /dev/null
+    - ../autogen.sh --disable-silent-rules $CONFIGURE_FLAGS
+    - make
+    - make distcheck
+    - popd > /dev/null
+    - mkdir -p _tarball_dir
+    - tar xf _build/libevdev-*.tar.xz -C _tarball_dir
+    - pushd _tarball_dir/libevdev-*/ > /dev/null
+    - meson "$MESON_BUILDDIR" --prefix="$INSTALLDIR"
+    - ninja -C "$MESON_BUILDDIR" test
+    - ninja -C "$MESON_BUILDDIR" install
+    - popd > /dev/null
+    - ls -lR $INSTALLDIR
+  needs: ['fedora:31@container-prep']
+
+autotools-from-tarball:
+  extends:
+    - .fedora:31
+  stage: tarballs
+  script:
+    - export INSTALLDIR="$PWD/_inst"
+    - meson "$MESON_BUILDDIR"
+    - ninja -C "$MESON_BUILDDIR" dist
+    - mkdir -p _tarball_dir
+    - tar xf "$MESON_BUILDDIR"/meson-dist/libevdev-*.xz -C _tarball_dir
+    - pushd _tarball_dir/libevdev-*/ > /dev/null
+    - mkdir _build
+    - pushd _build > /dev/null
+    - ../autogen.sh --disable-silent-rules --prefix="$INSTALLDIR" $CONFIGURE_FLAGS
+    - make
+    - make install
+    - make distcheck
+    - popd > /dev/null
+    - popd > /dev/null
+    - ls -lR $INSTALLDIR
+  needs: ['fedora:31@container-prep']
\ No newline at end of file