.gitlab-ci.yml 25.5 KB
Newer Older
1
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
2 3 4 5 6 7 8

########################################
#                                      #
# THIS FILE IS GENERATED, DO NOT EDIT  #
#                                      #
########################################

Benjamin Tissoires's avatar
Benjamin Tissoires committed
9 10 11
#
# This is a bit complicated for two reasons:
# - we really want to run dnf/apt/... only once, updating on the test runner for
12 13
#   each job takes forever. So we create a container image for each distribution
#   tested, then run the tests on this container image.
Benjamin Tissoires's avatar
Benjamin Tissoires committed
14
#
15
#   Creating a container image is time-consuming, so we only do so for pushes to
Benjamin Tissoires's avatar
Benjamin Tissoires committed
16 17 18 19 20 21 22 23
#   libinput directly (not merge requests) and if the current image is 'old'.
#
# - GitLab only allows one script: set per job but we have a bunch of commands
#   we need to re-run for each build (meson && ninja && etc). YAML cannot merge
#   arrays templates so we're screwed.
#
#   So instead we use a default_build template and override everything with
#   variables. The only two variables that matter:
24
#     MESON_ARGS=-Denable-something=true
Benjamin Tissoires's avatar
Benjamin Tissoires committed
25 26 27 28 29 30 31
#     NINJA_ARGS=dist ... to run 'ninja -C builddir dist'
#   Note that you cannot use scripts: in any target if you expect default_build
#   to work.
#
#
# All jobs must follow the naming scheme of
# <distribution>:<version>@activity:
32
#  e.g. fedora:31@build-default
Benjamin Tissoires's avatar
Benjamin Tissoires committed
33

34
.templates_sha: &template_sha 395535ce90eb48e260c0dff12c35d9237e22c539 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
35

36
include:
37
  # Alpine container builder template
38
  - project: 'freedesktop/ci-templates'
39
    ref: *template_sha
40
    file: '/templates/alpine.yml'
41
  # Arch container builder template
42
  - project: 'freedesktop/ci-templates'
43
    ref: *template_sha
44
    file: '/templates/arch.yml'
45
  # Fedora container builder template
46
  - project: 'freedesktop/ci-templates'
47
    ref: *template_sha
48
    file: '/templates/fedora.yml'
49
  # Ubuntu container builder template
50
  - project: 'freedesktop/ci-templates'
51
    ref: *template_sha
52
    file: '/templates/ubuntu.yml'
53

Benjamin Tissoires's avatar
Benjamin Tissoires committed
54
stages:
55
  - prep             # prep work like rebuilding the container images if there is a change
Peter Hutterer's avatar
Peter Hutterer committed
56 57
  - build            # for actually building and testing things in a container
  - VM               # for running the test suite in a VM
58
  - valgrind         # for running the test suite under valgrind in a VM
Peter Hutterer's avatar
Peter Hutterer committed
59
  - distro           # distribs test
60
  - deploy           # trigger wayland's website generation
61
  - container_clean  # clean up unused container images
Benjamin Tissoires's avatar
Benjamin Tissoires committed
62 63

variables:
64 65 66 67 68 69 70 71 72 73
  ###############################################################################
  # This is the list of packages required to build libinput with the default    #
  # configuration.                                                              #
  #                                                                             #
  # Run dnf install/apt-get install/.. with the list of packages for your       #
  # distribution                                                                #
  #                                                                             #
  # See the documentation here:                                                 #
  # https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html  #
  ###############################################################################
74
  FEDORA_PACKAGES:    'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme python3-pytest-xdist libwacom-devel cairo-devel   gtk3-devel   glib2-devel    mtdev-devel diffutils'
75
  FEDORA_QEMU_RPMS:   'git gcc gcc-c++ pkgconf-pkg-config meson check-devel libudev-devel libevdev-devel doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx_rtd_theme python3-pytest-xdist libwacom-devel cairo-devel   gtk3-devel   glib2-devel    mtdev-devel diffutils valgrind'
76 77
  UBUNTU_PACKAGES:    'git gcc g++     pkg-config         meson check       libudev-dev   libevdev-dev   doxygen graphviz python3-sphinx python3-recommonmark python3-sphinx-rtd-theme python3-pytest-xdist libwacom-dev   libcairo2-dev libgtk-3-dev libglib2.0-dev libmtdev-dev'
  ARCH_PACKAGES:      'git gcc         pkgconfig          meson check       libsystemd    libevdev       doxygen graphviz python-sphinx  python-recommonmark  python-sphinx_rtd_theme  python-pytest-xdist  libwacom                     gtk3                        mtdev      diffutils'
78
  FREEBSD_BUILD_PKGS: 'meson'
79
  FREEBSD_PKGS:       'libepoll-shim                                        libudev-devd  libevdev                                                                                     libwacom                     gtk3                        libmtdev   '
80
  ALPINE_PACKAGES:    'git gcc build-base pkgconfig       meson check-dev   eudev-dev     libevdev-dev                                                                                 libwacom-dev   cairo-dev     gtk+3.0-dev  mtdev-dev bash'
81
  ############################ end of package lists #############################
82

83
  # these tags should be updated each time the list of packages is updated
84 85 86
  # changing these will force rebuilding the associated image
  # Note: these tags have no meaning and are not tied to a particular
  # libinput version
87 88 89 90 91 92
  FEDORA_TAG:  '2020-03-17.0'
  UBUNTU_TAG:  '2020-03-17.0'
  ARCH_TAG:    '2020-03-17.0'
  ALPINE_TAG:  '2020-03-17.0'
  FREEBSD_TAG: '2020-03-17.0'
  QEMU_TAG:    'qemu-vm-2020-03-17.0'
93 94

  UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"
95 96

  FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/freebsd/11.2:$FREEBSD_TAG
97
  FDO_UPSTREAM_REPO: libinput/libinput
98

99
  MESON_BUILDDIR: "build dir"
100
  NINJA_ARGS: ''
101
  MESON_ARGS: ''
102
  MESON_TEST_ARGS: '--no-suite=hardware'
103

104 105
  # udev isn't available/working properly in the containers
  UDEV_NOT_AVAILABLE: 1
Peter Hutterer's avatar
Peter Hutterer committed
106
  GIT_DEPTH: 1
Benjamin Tissoires's avatar
Benjamin Tissoires committed
107

108 109 110 111 112 113 114 115 116
.policy:
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure
  # cancel run when a newer version is pushed to the branch
  interruptible: true

117
.default_artifacts:
Benjamin Tissoires's avatar
Benjamin Tissoires committed
118 119 120 121 122 123
  artifacts:
    name: "meson-logs-$CI_JOB_NAME"
    when: always
    expire_in: 1 week
    paths:
      - $MESON_BUILDDIR/meson-logs
124 125
    reports:
      junit: $MESON_BUILDDIR/junit-*.xml
Benjamin Tissoires's avatar
Benjamin Tissoires committed
126 127 128

#################################################################
#                                                               #
129
#                          prep stage                           #
Benjamin Tissoires's avatar
Benjamin Tissoires committed
130 131 132
#                                                               #
#################################################################

133 134 135 136 137 138 139 140 141
# 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
142
    - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
143
  script:
144
    - ci-fairy generate-template
145 146 147 148
    - git diff --exit-code && exit 0 || true
    - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
    - exit 1

149 150 151
#
# Verify that commit messages are as expected, signed-off, etc.
#
152 153

check-commit:
154
  image: golang:alpine
155
  stage: prep
156 157
  before_script:
    - apk add python3 git
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
  script:
    - pip3 install GitPython
    - pip3 install pytest
    - |
      pytest --junitxml=results.xml \
             --tb=line \
             --assert=plain \
             ./.gitlab-ci/check-commit.py
  except:
    - master@libinput/libinput
  variables:
    GIT_DEPTH: 100
  artifacts:
    reports:
      junit: results.xml

174 175 176 177
#
# This stage will recreate the container images only if the image
# is too old or if it is missing some dependencies.
#
Benjamin Tissoires's avatar
Benjamin Tissoires committed
178

179
.rebuild_for_schedule:
180
  before_script:
181
    # force rebuild if schedule, reuse otherwise
182
    - if [[ $CI_PIPELINE_SOURCE == "schedule" ]] ; then export FDO_FORCE_REBUILD=1; fi
183

184
fedora:32@qemu-prep:
185
  extends:
186
    - .fdo.qemu-build@fedora
187
    - .policy
188
    - .rebuild_for_schedule
189
  stage: prep
190 191 192 193
  tags:
    - kvm
  variables:
    GIT_STRATEGY: none
194
    FDO_DISTRIBUTION_VERSION: 32
195 196
    FDO_DISTRIBUTION_TAG: $QEMU_TAG
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_QEMU_RPMS
197
  allow_failure: true
198

199
fedora:30@container-prep:
200
  extends:
201
    - .fdo.container-build@fedora
202
    - .policy
203
    - .rebuild_for_schedule
204
  stage: prep
Benjamin Tissoires's avatar
Benjamin Tissoires committed
205 206
  variables:
    GIT_STRATEGY: none
207 208 209
    FDO_DISTRIBUTION_VERSION: '30'
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
Benjamin Tissoires's avatar
Benjamin Tissoires committed
210

211
fedora:31@container-prep:
212
  extends:
213
    - .fdo.container-build@fedora
214
    - .policy
215
    - .rebuild_for_schedule
216
  stage: prep
Benjamin Tissoires's avatar
Benjamin Tissoires committed
217 218
  variables:
    GIT_STRATEGY: none
219 220 221
    FDO_DISTRIBUTION_VERSION: '31'
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
222

223 224 225 226 227 228 229 230 231 232 233 234
fedora:32@container-prep:
  extends:
    - .fdo.container-build@fedora
    - .policy
    - .rebuild_for_schedule
  stage: prep
  variables:
    GIT_STRATEGY: none
    FDO_DISTRIBUTION_VERSION: '32'
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG

235
ubuntu:19.10@container-prep:
236
  extends:
237
    - .fdo.container-build@ubuntu
238
    - .policy
239
    - .rebuild_for_schedule
240
  stage: prep
Benjamin Tissoires's avatar
Benjamin Tissoires committed
241 242
  variables:
    GIT_STRATEGY: none
243 244 245
    FDO_DISTRIBUTION_VERSION: '19.10'
    FDO_DISTRIBUTION_PACKAGES: $UBUNTU_PACKAGES
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
Benjamin Tissoires's avatar
Benjamin Tissoires committed
246

247
arch:rolling@container-prep:
248
  extends:
249
    - .fdo.container-build@arch
250
    - .policy
251
    - .rebuild_for_schedule
252
  stage: prep
253 254
  variables:
    GIT_STRATEGY: none
255 256 257
    FDO_DISTRIBUTION_VERSION: 'rolling'
    FDO_DISTRIBUTION_PACKAGES: $ARCH_PACKAGES
    FDO_DISTRIBUTION_TAG: $ARCH_TAG
258

259
alpine:latest@container-prep:
260
  extends:
261
    - .fdo.container-build@alpine
262
    - .policy
263
    - .rebuild_for_schedule
264
  stage: prep
265 266
  variables:
    GIT_STRATEGY: none
267 268 269 270
    FDO_DISTRIBUTION_VERSION: 'latest'
    FDO_DISTRIBUTION_PACKAGES: $ALPINE_PACKAGES
    FDO_DISTRIBUTION_TAG: $ALPINE_TAG

271

272

273 274 275
# Note that we want to use the latest buildah image, and for that
# we use one of the .fdo.container-build@distribution by replacing the
# `script`.
276
.freebsd@container-prep:
277 278
  extends:
    - .policy
279
    - .fdo.container-build@fedora
280
  stage: prep
281
  script:
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298
    # log in to the registry
    - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY

    # get the full container image name
    - export IMAGE=freebsd/$FREEBSD_VERSION:$FREEBSD_TAG

    # force rebuild if schedule, reuse otherwise
    - if [[ $CI_PIPELINE_SOURCE == "schedule" ]] ; then touch .scheduled; fi

    # pull the latest upstream image if it exists
    - test -e .scheduled || skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD
                                 docker://$CI_REGISTRY/$FDO_UPSTREAM_REPO/$IMAGE
                                 docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;

    # check if our image is already in the current registry
    - test -e .scheduled || skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;

299
    - export BUILDAH_RUN="buildah run --isolation chroot"
300
    - export BUILDAH_COMMIT="buildah commit --format docker"
301
    - buildcntr=$(buildah from --quiet  myfreeweb/freebsd-cross:latest)
302 303 304
    - $BUILDAH_RUN $buildcntr apk add --no-cache $FREEBSD_BUILD_PKGS
    - $BUILDAH_RUN $buildcntr pkg -r /freebsd update -f
    - $BUILDAH_RUN $buildcntr pkg -r /freebsd install -y $FREEBSD_PKGS
305 306
    - buildah config --workingdir /app $buildcntr
    # tag the current container
307
    - $BUILDAH_COMMIT $buildcntr $FREEBSD_CONTAINER_IMAGE
308 309 310 311
    # clean up the working container
    - buildah rm $buildcntr

    # push the container image to the libinput registry
312
    - podman push --quiet $FREEBSD_CONTAINER_IMAGE
Peter Hutterer's avatar
Peter Hutterer committed
313 314 315
    - skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD
        docker://$FREEBSD_CONTAINER_IMAGE
        docker://$CI_REGISTRY_IMAGE/freebsd/$FREEBSD_VERSION:$CI_JOB_ID
316

317
freebsd:11.2@container-prep:
318 319
  extends:
    - .freebsd@container-prep
320 321
  variables:
    GIT_STRATEGY: none
322
    FREEBSD_VERSION: "11.2"
323

324

325 326
#################################################################
#                                                               #
327
#                   container clean stage                       #
328
#                 run during the clean stage                    #
329 330 331 332
#                                                               #
#################################################################

#
333
# This stage will look for the container images we currently have in
334 335
# the registry and will remove any that are not tagged with the provided
# $container_image:$tag
336
#
337
.container-clean:
338
  stage: container_clean
339 340
  extends:
    - .policy
341 342 343 344
  image: golang:alpine
  before_script:
    - apk add python3 git
    - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
345
  script:
346 347 348 349 350 351 352 353
    # Go to your Profile, Settings, Access Tokens
    # Create a personal token with 'api' scope, copy the value.
    # Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
    # Define a variable of type File named AUTHFILE. Content is that token
    # value.
    - ci-fairy -v --authfile $AUTHFILE delete-image
            --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
            --exclude-tag $FDO_DISTRIBUTION_TAG
354 355
  dependencies: []
  allow_failure: true
356 357
  only:
    - schedules
358

359
fedora:30@container-clean:
360 361
  extends:
    - .container-clean
362 363
  variables:
    GIT_STRATEGY: none
364
    FEDORA_VERSION: '30'
365 366 367
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '30'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
368

369
fedora:31@container-clean:
370 371
  extends:
    - .container-clean
372 373
  variables:
    GIT_STRATEGY: none
374
    FEDORA_VERSION: '31'
375 376 377
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '31'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
378

379 380 381 382 383 384 385 386 387 388
fedora:32@container-clean:
  extends:
    - .container-clean
  variables:
    GIT_STRATEGY: none
    FEDORA_VERSION: '32'
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '32'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG

389
ubuntu:19.10@container-clean:
390 391
  extends:
    - .container-clean
392 393
  variables:
    GIT_STRATEGY: none
394
    UBUNTU_VERSION: '19.10'
395 396 397
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '19.10'
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
398

399
arch:rolling@container-clean:
400 401
  extends:
    - .container-clean
402 403
  variables:
    GIT_STRATEGY: none
404
    ARCH_VERSION: 'rolling'
405 406 407
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/arch/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: 'rolling'
    FDO_DISTRIBUTION_TAG: $ARCH_TAG
408

409
alpine:latest@container-clean:
410 411
  extends:
    - .container-clean
412 413
  variables:
    GIT_STRATEGY: none
414
    ALPINE_VERSION: 'latest'
415 416 417
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/alpine/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: 'latest'
    FDO_DISTRIBUTION_TAG: $ALPINE_TAG
418

419

420
freebsd:11.2@container-clean:
421 422
  extends:
    - .container-clean
423 424
  variables:
    GIT_STRATEGY: none
425
    CURRENT_CONTAINER_IMAGE: $FREEBSD_CONTAINER_IMAGE
426

Benjamin Tissoires's avatar
Benjamin Tissoires committed
427 428 429 430 431 432
#################################################################
#                                                               #
#                       build stage                             #
#                                                               #
#################################################################

433
.build@template:
434 435
  extends:
    - .policy
436
    - .default_artifacts
437
  stage: build
438 439
  script:
    - .gitlab-ci/meson-build.sh
440 441
  dependencies: []

Benjamin Tissoires's avatar
Benjamin Tissoires committed
442 443 444 445
#
# Fedora
#

446 447 448 449 450 451 452 453
.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

454 455 456 457
# Run in a test suite. Special variables:
# - SUITES: the meson test suites to run, or
# - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
# Set one or the other, not both.
458
.test-suite-vm:
459 460
  extends:
    - .policy
461
    - .fdo.distribution-image@fedora
Peter Hutterer's avatar
Peter Hutterer committed
462
  stage: VM
463 464 465 466
  tags:
    - kvm
  variables:
    MESON_BUILDDIR: build_dir
467 468 469 470 471
    # remove the global --no-suite=hardware
    MESON_TEST_ARGS: ''
  before_script:
    - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
    - echo "Testing $SUITES"
472 473
  script:
    # start our vm, no args required
474
    - /app/start_vm.sh || (echo "Error - Failed to start the VM." && exit 1)
475 476 477 478

    - *check_tainted

    - "scp -P 5555 -r $PWD localhost:"
479 480
    - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
    - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
481
    - echo "MESON_ARGS=\"$MESON_ARGS\"" >> sshenv
482 483 484 485 486
    - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
    - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS $SUITES\"" >> 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
487 488 489 490 491 492 493
    # 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
494
    - pkill qemu || true
495 496 497 498 499 500 501 502 503 504 505 506

    - 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
507 508
    reports:
      junit: $MESON_BUILDDIR/junit-*.xml
509 510

  allow_failure: true
511 512 513
  retry:
    max: 2
    when: script_failure
514 515


516
.fedora:32@test-suite-vm:
517 518
  extends:
    - .test-suite-vm
519
  variables:
520
    FDO_DISTRIBUTION_VERSION: 32
521
    FDO_DISTRIBUTION_TAG: $QEMU_TAG
522 523
  needs:
    - "fedora:32@qemu-prep"
524

525

526
vm-touchpad:
527
  extends:
528
    - .fedora:32@test-suite-vm
529 530 531
  variables:
    SUITE_NAMES: 'touchpad'

532
vm-touchpad-no-libwacom:
533
  extends:
534
    - vm-touchpad
535 536 537
  variables:
    MESON_ARGS: '-Dlibwacom=false'

538
vm-tap:
539
  extends:
540
    - .fedora:32@test-suite-vm
541 542 543
  variables:
    SUITE_NAMES: 'tap'

544
vm-tap-no-libwacom:
545
  extends:
546
    - vm-tap
547 548 549
  variables:
    MESON_ARGS: '-Dlibwacom=false'

550
vm-tablet:
551
  extends:
552
    - .fedora:32@test-suite-vm
553 554 555
  variables:
    SUITE_NAMES: 'tablet'

556
vm-tablet-no-libwacom:
557
  extends:
558
    - vm-tablet
559 560 561
  variables:
    MESON_ARGS: '-Dlibwacom=false'

562
vm-gestures-device:
563
  extends:
564
    - .fedora:32@test-suite-vm
565 566 567
  variables:
    SUITE_NAMES: 'gestures device'

568
vm-gestures-device-no-libwacom:
569
  extends:
570
    - vm-gestures-device
571 572 573
  variables:
    MESON_ARGS: '-Dlibwacom=false'

574
vm-others:
575
  extends:
576
    - .fedora:32@test-suite-vm
577 578 579
  variables:
    SUITE_NAMES: 'context config misc events totem udev lid log timer tablet-mode quirks trackball pad path keyboard switch touch trackpoint'

580
vm-others-no-libwacom:
581
  extends:
582
    - vm-others
583 584 585
  variables:
    MESON_ARGS: '-Dlibwacom=false'

586
vm-pointer:
587
  extends:
588
    - .fedora:32@test-suite-vm
589 590 591
  variables:
    SUITE_NAMES: 'pointer'

592
vm-pointer-no-libwacom:
593
  extends:
594
    - vm-pointer
595 596 597
  variables:
    MESON_ARGS: '-Dlibwacom=false'

598

599
vm-valgrind-touchpad:
600
  stage: valgrind
601
  extends:
602
    - vm-touchpad
603 604 605
  variables:
    MESON_TEST_ARGS: '--setup=valgrind'

606
vm-valgrind-tap:
607
  stage: valgrind
608
  extends:
609
    - vm-tap
610 611 612
  variables:
    MESON_TEST_ARGS: '--setup=valgrind'

613
vm-valgrind-tablet:
614
  stage: valgrind
615
  extends:
616
    - vm-tablet
617 618 619
  variables:
    MESON_TEST_ARGS: '--setup=valgrind'

620
vm-valgrind-gestures-device:
621
  stage: valgrind
622
  extends:
623
    - vm-gestures-device
624 625 626
  variables:
    MESON_TEST_ARGS: '--setup=valgrind'

627
vm-valgrind-others:
628
  stage: valgrind
629
  extends:
630
    - vm-others
631 632 633
  variables:
    MESON_TEST_ARGS: '--setup=valgrind'

634
vm-valgrind-pointer:
635
  stage: valgrind
636
  extends:
637
    - vm-pointer
638
  variables:
639
    MESON_TEST_ARGS: '--setup=valgrind'
640

641

642
.fedora-build@template:
643
  extends:
644
    - .fdo.distribution-image@fedora
645
    - .build@template
646
  variables:
647
    FDO_DISTRIBUTION_VERSION: '32'
648
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
649 650
  needs:
    - "fedora:32@container-prep"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
651

652
default-build-release@fedora:32:
Peter Hutterer's avatar
Peter Hutterer committed
653
  stage: distro
654 655
  extends:
    - .fedora-build@template
656 657 658 659
  variables:
    MESON_ARGS: "-Dbuildtype=release"
    CFLAGS: "-Werror"

660
scan-build@fedora:32:
661 662
  extends:
    - .fedora-build@template
663 664
  variables:
    NINJA_ARGS: scan-build
665
    MESON_TEST_ARGS: ''
666 667 668
  before_script:
    - dnf install -y clang-analyzer findutils
  after_script:
669 670
    - test ! -d "$MESON_BUILDDIR"/meson-logs/scanbuild && exit 0
    - test $(find "$MESON_BUILDDIR"/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 && exit 0
671 672 673
    - echo "Check scan-build results"
    - /bin/false

Benjamin Tissoires's avatar
Benjamin Tissoires committed
674 675 676 677
# Below jobs are build option combinations. We only
# run them on one image, they shouldn't fail on one distro
# when they succeed on another.

678
build-no-libwacom@fedora:32:
679 680
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
681
  variables:
682
    MESON_ARGS: "-Dlibwacom=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
683

684
build-no-libwacom-nodeps@fedora:32:
685 686
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
687
  variables:
688
    MESON_ARGS: "-Dlibwacom=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
689 690 691
  before_script:
    - dnf remove -y libwacom libwacom-devel

692
build-no-docs@fedora:32:
693 694
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
695
  variables:
696
    MESON_ARGS: "-Ddocumentation=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
697

698
build-no-docs-nodeps@fedora:32:
699 700
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
701
  variables:
702
    MESON_ARGS: "-Ddocumentation=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
703 704 705
  before_script:
    - dnf remove -y doxygen graphviz

706
build-no-debuggui@fedora:32:
707 708
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
709
  variables:
710
    MESON_ARGS: "-Ddebug-gui=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
711

712
build-no-debuggui-nodeps@fedora:32:
713 714
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
715
  variables:
716
    MESON_ARGS: "-Ddebug-gui=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
717 718 719
  before_script:
    - dnf remove -y gtk3-devel

720
build-no-tests@fedora:32:
721 722
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
723
  variables:
724
    MESON_ARGS: "-Dtests=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
725

726
build-no-tests-nodeps@fedora:32:
727 728
  extends:
    - .fedora-build@template
Benjamin Tissoires's avatar
Benjamin Tissoires committed
729
  variables:
730
    MESON_ARGS: "-Dtests=false"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
731 732 733
  before_script:
    - dnf remove -y check-devel

734
valgrind@fedora:32:
735 736
  extends:
    - .fedora-build@template
737
  variables:
738
    MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
739 740
  before_script:
    - dnf install -y valgrind
741 742 743

# Python checks, only run on Fedora

744
usr-bin-env-python@fedora:32:
745 746
  extends:
    - .fedora-build@template
747 748 749 750 751 752 753
  script:
    - |
      if git grep -l '^#!/usr/bin/python'; then
        echo "Use '/usr/bin/env python3' in the above files";
        /bin/false
      fi

754
flake8@fedora:32:
755 756
  extends:
    - .fedora-build@template
757 758 759 760 761
  before_script:
    - dnf install -y python3-flake8
  script:
    - flake8-3 --ignore=W501,E501,W504 $(git grep -l '^#!/usr/bin/env python3')

762 763 764 765 766
#################################################################
#                                                               #
#                        distro stage                           #
#                                                               #
#################################################################
Benjamin Tissoires's avatar
Benjamin Tissoires committed
767

768
fedora:30@default-build:
Peter Hutterer's avatar
Peter Hutterer committed
769
  stage: distro
770 771
  extends:
    - .build@template
772
    - .fdo.distribution-image@fedora
773
  variables:
774 775
    FDO_DISTRIBUTION_VERSION: '30'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
776 777
  needs:
    - "fedora:30@container-prep"
778 779 780 781 782 783


fedora:31@default-build:
  stage: distro
  extends:
    - .build@template
784
    - .fdo.distribution-image@fedora
785
  variables:
786 787
    FDO_DISTRIBUTION_VERSION: '31'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
788 789
  needs:
    - "fedora:31@container-prep"
790

Benjamin Tissoires's avatar
Benjamin Tissoires committed
791

792 793 794 795 796 797 798 799
fedora:32@default-build:
  stage: distro
  extends:
    - .build@template
    - .fdo.distribution-image@fedora
  variables:
    FDO_DISTRIBUTION_VERSION: '32'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
800 801
  needs:
    - "fedora:32@container-prep"
802 803


804
ubuntu:19.10@default-build:
805
  stage: distro
806
  extends:
807
    - .build@template
808
    - .fdo.distribution-image@ubuntu
Benjamin Tissoires's avatar
Benjamin Tissoires committed
809
  variables:
810 811
    FDO_DISTRIBUTION_VERSION: '19.10'
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
812 813
  needs:
    - "ubuntu:19.10@container-prep"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
814

815 816

arch:rolling@default-build:
Peter Hutterer's avatar
Peter Hutterer committed
817
  stage: distro
818 819
  extends:
    - .build@template
820
    - .fdo.distribution-image@arch
821
  variables:
822 823
    FDO_DISTRIBUTION_VERSION: 'rolling'
    FDO_DISTRIBUTION_TAG: $ARCH_TAG
824 825
  needs:
    - "arch:rolling@container-prep"
826

827

828
alpine:latest@default-build:
829
  stage: distro
830 831
  extends:
    - .build@template
832
    - .fdo.distribution-image@alpine
833
  variables:
834 835
    FDO_DISTRIBUTION_VERSION: 'latest'
    FDO_DISTRIBUTION_TAG: $ALPINE_TAG
836 837
    MESON_ARGS: '-Ddocumentation=false' # alpine does not have python-recommonmark
    MESON_TEST_ARGS: '' # litest-selftest fails on musl
838 839
  needs:
    - "alpine:latest@container-prep"
840 841


842

843 844 845
#
# FreeBSD
#
846
.freebsd@template:
Peter Hutterer's avatar
Peter Hutterer committed
847
  stage: distro
848 849
  extends:
    - .build@template
850
  image: $FREEBSD_CONTAINER_IMAGE
851 852
  variables:
    MESON_ARGS: '--cross-file freebsd -Ddocumentation=false -Dtests=false -Depoll-dir=/freebsd/usr/local/'
853 854
    # Can't run FreeBSD tests on Linux machine, so MESON_TEST_ARGS shouldn't be "test"
    MESON_TEST_ARGS: ''
855 856

freebsd:11.2@default-build: