.gitlab-ci.yml 28.1 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
# This is a bit complicated for two reasons:
# - we really want to run dnf/apt/... only once, updating on the test runner for
11 12
#   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
13
#
14 15
#   This is handled by the ci-templates, ensuring containers are only rebuilt
#   when the TAG changes.
Benjamin Tissoires's avatar
Benjamin Tissoires committed
16 17 18
#
# - 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
19
#   arrays so we're screwed.
Benjamin Tissoires's avatar
Benjamin Tissoires committed
20 21 22
#
#   So instead we use a default_build template and override everything with
#   variables. The only two variables that matter:
23
#     MESON_ARGS=-Denable-something=true
Benjamin Tissoires's avatar
Benjamin Tissoires committed
24 25 26 27 28 29 30
#     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:
31
#  e.g. fedora:31@build-default
Benjamin Tissoires's avatar
Benjamin Tissoires committed
32

33
.templates_sha: &template_sha 16f790f93f893394b70d7048fb0e8a981ceaa3c5 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
34

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

Benjamin Tissoires's avatar
Benjamin Tissoires committed
60
stages:
61
  - sanity check     # CI/commit checks
62
  - prep             # prep work like rebuilding the container images if there is a change
Peter Hutterer's avatar
Peter Hutterer committed
63 64
  - build            # for actually building and testing things in a container
  - VM               # for running the test suite in a VM
65
  - valgrind         # for running the test suite under valgrind in a VM
Peter Hutterer's avatar
Peter Hutterer committed
66
  - distro           # distribs test
67
  - deploy           # trigger wayland's website generation
68
  - container_clean  # clean up unused container images (scheduled jobs only)
Benjamin Tissoires's avatar
Benjamin Tissoires committed
69 70

variables:
71 72 73 74 75 76 77 78 79 80
  ###############################################################################
  # 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  #
  ###############################################################################
81
  FEDORA_PACKAGES:  'git-core 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'
82
  DEBIAN_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 curl'
83 84 85 86
  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'
  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'
  FREEBSD_PACKAGES: 'libepoll-shim libudev-devd libevdev libwacom gtk3 libmtdev'
87
  FREEBSD_BUILD_PKGS: 'meson'
88
  ############################ end of package lists #############################
89

90
  # these tags should be updated each time the list of packages is updated
91 92 93
  # changing these will force rebuilding the associated image
  # Note: these tags have no meaning and are not tied to a particular
  # libinput version
94 95 96 97 98 99 100
  FEDORA_TAG:  '2020-11-16.0'
  DEBIAN_TAG:  '2020-11-16.0'
  UBUNTU_TAG:  '2020-11-16.0'
  ARCH_TAG:    '2020-11-16.0'
  ALPINE_TAG:  '2020-11-16.0'
  FREEBSD_TAG: '2020-11-16.0'
  QEMU_TAG:    'qemu-vm-2020-11-16.0'
101

102
  FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/freebsd/11.2:$FREEBSD_TAG
103
  FDO_UPSTREAM_REPO: libinput/libinput
104

105
  MESON_BUILDDIR: "build dir"
106
  NINJA_ARGS: ''
107
  MESON_ARGS: ''
108
  MESON_TEST_ARGS: '--no-suite=hardware'
109

110 111
  # udev isn't available/working properly in the containers
  UDEV_NOT_AVAILABLE: 1
Peter Hutterer's avatar
Peter Hutterer committed
112
  GIT_DEPTH: 1
Benjamin Tissoires's avatar
Benjamin Tissoires committed
113

114 115 116 117 118 119 120 121 122
.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

123
.default_artifacts:
Benjamin Tissoires's avatar
Benjamin Tissoires committed
124 125 126 127 128 129
  artifacts:
    name: "meson-logs-$CI_JOB_NAME"
    when: always
    expire_in: 1 week
    paths:
      - $MESON_BUILDDIR/meson-logs
130 131
    reports:
      junit: $MESON_BUILDDIR/junit-*.xml
Benjamin Tissoires's avatar
Benjamin Tissoires committed
132

133

Benjamin Tissoires's avatar
Benjamin Tissoires committed
134 135
#################################################################
#                                                               #
136
#                     sanity check stage                        #
Benjamin Tissoires's avatar
Benjamin Tissoires committed
137 138 139
#                                                               #
#################################################################

140 141 142 143 144
# 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:
145
  extends:
146
    - .fdo.ci-fairy
147
  stage: sanity check
148
  script:
149
    - ci-fairy generate-template --verify && exit 0 || true
150 151 152
    - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
    - exit 1

153 154 155
#
# Verify that commit messages are as expected, signed-off, etc.
#
156 157

check-commit:
158
  extends:
159
    - .fdo.ci-fairy
160
  stage: sanity check
161
  script:
162
    - ci-fairy check-commits --signed-off-by --junit-xml=results.xml
163 164 165 166 167 168 169 170
  except:
    - master@libinput/libinput
  variables:
    GIT_DEPTH: 100
  artifacts:
    reports:
      junit: results.xml

171 172 173 174 175
#################################################################
#                                                               #
#                          prep stage                           #
#                                                               #
#################################################################
176

177
#
178 179
# Note: images are rebuilt weekly with a scheduled pipeline with FDO_FORCE_REBUILD set
#
180
#
181
fedora:32@qemu-prep:
182
  extends:
183
    - .fdo.qemu-build@fedora
184
    - .policy
185
  stage: prep
186 187 188 189
  tags:
    - kvm
  variables:
    GIT_STRATEGY: none
190
    FDO_DISTRIBUTION_VERSION: 32
191
    FDO_DISTRIBUTION_TAG: $QEMU_TAG
192
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
193
  allow_failure: true
194

195
fedora:31@container-prep:
196
  extends:
197
    - .fdo.container-build@fedora
198
    - .policy
199
  stage: prep
Benjamin Tissoires's avatar
Benjamin Tissoires committed
200 201
  variables:
    GIT_STRATEGY: none
202 203 204
    FDO_DISTRIBUTION_VERSION: '31'
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
205

206 207 208 209 210 211 212 213 214 215 216
fedora:32@container-prep:
  extends:
    - .fdo.container-build@fedora
    - .policy
  stage: prep
  variables:
    GIT_STRATEGY: none
    FDO_DISTRIBUTION_VERSION: '32'
    FDO_DISTRIBUTION_PACKAGES: $FEDORA_PACKAGES
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG

217 218 219 220 221 222 223 224 225 226 227
debian:stable@container-prep:
  extends:
    - .fdo.container-build@debian
    - .policy
  stage: prep
  variables:
    GIT_STRATEGY: none
    FDO_DISTRIBUTION_VERSION: 'stable'
    FDO_DISTRIBUTION_PACKAGES: $DEBIAN_PACKAGES
    FDO_DISTRIBUTION_TAG: $DEBIAN_TAG

228
ubuntu:20.04@container-prep:
229
  extends:
230
    - .fdo.container-build@ubuntu
231
    - .policy
232
  stage: prep
Benjamin Tissoires's avatar
Benjamin Tissoires committed
233 234
  variables:
    GIT_STRATEGY: none
235 236 237 238 239 240 241 242 243 244 245 246
    FDO_DISTRIBUTION_VERSION: '20.04'
    FDO_DISTRIBUTION_PACKAGES: $UBUNTU_PACKAGES
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG

ubuntu:20.10@container-prep:
  extends:
    - .fdo.container-build@ubuntu
    - .policy
  stage: prep
  variables:
    GIT_STRATEGY: none
    FDO_DISTRIBUTION_VERSION: '20.10'
247 248
    FDO_DISTRIBUTION_PACKAGES: $UBUNTU_PACKAGES
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
Benjamin Tissoires's avatar
Benjamin Tissoires committed
249

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

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

272

273

274 275 276
# 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`.
277
.freebsd@container-prep:
278 279
  extends:
    - .policy
280
    - .fdo.container-build@fedora
281
  stage: prep
282
  script:
283 284 285 286 287 288
    # 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

289
    - if [[ x"$FDO_FORCE_REBUILD" != x ]] ; then touch .rebuild; fi
290 291

    # pull the latest upstream image if it exists
292
    - test -e .rebuild || skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD
293 294 295 296
                                 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
297
    - test -e .rebuild || skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
298

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
    - $BUILDAH_RUN $buildcntr apk add --no-cache $FREEBSD_BUILD_PKGS
    - $BUILDAH_RUN $buildcntr pkg -r /freebsd update -f
304
    - $BUILDAH_RUN $buildcntr pkg -r /freebsd install -y $FREEBSD_PACKAGES
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 339
  extends:
    - .policy
340
    - .fdo.ci-fairy
341
  stage: container_clean
342
  script:
343 344 345 346 347 348 349 350
    # 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
351 352
  dependencies: []
  allow_failure: true
353 354
  only:
    - schedules
355

356
fedora:31@container-clean:
357 358
  extends:
    - .container-clean
359 360
  variables:
    GIT_STRATEGY: none
361 362 363
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '31'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
364

365 366 367 368 369 370 371 372 373
fedora:32@container-clean:
  extends:
    - .container-clean
  variables:
    GIT_STRATEGY: none
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/fedora/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '32'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG

374 375 376 377 378 379 380 381 382
debian:stable@container-clean:
  extends:
    - .container-clean
  variables:
    GIT_STRATEGY: none
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/debian/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: 'stable'
    FDO_DISTRIBUTION_TAG: $DEBIAN_TAG

383
ubuntu:20.04@container-clean:
384 385
  extends:
    - .container-clean
386 387
  variables:
    GIT_STRATEGY: none
388
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
389 390 391 392 393 394 395 396 397 398
    FDO_DISTRIBUTION_VERSION: '20.04'
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG

ubuntu:20.10@container-clean:
  extends:
    - .container-clean
  variables:
    GIT_STRATEGY: none
    CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/ubuntu/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
    FDO_DISTRIBUTION_VERSION: '20.10'
399
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
400

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

410
alpine:latest@container-clean:
411 412
  extends:
    - .container-clean
413 414
  variables:
    GIT_STRATEGY: none
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/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
475 476 477

    - *check_tainted

478
    - "scp -r $PWD vm:"
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
    - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
    - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS $SUITES\"" >> sshenv
    - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
485 486
    - "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment"
    - /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
487
    # no matter the results of the tests, we want to fetch the logs
488
    - scp -r vm:$CI_PROJECT_NAME/$MESON_BUILDDIR .
489 490 491

    - *check_tainted

492
    - /app/vmctl stop
493 494 495 496 497 498 499 500 501 502 503 504

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

  allow_failure: true
509 510 511
  retry:
    max: 2
    when: script_failure
512 513


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

523

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

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

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

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

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

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

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

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

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

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

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

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

596

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

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

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

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

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

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

639

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

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

658
scan-build@fedora:32:
659 660
  extends:
    - .fedora-build@template
661 662
  variables:
    NINJA_ARGS: scan-build
663
    MESON_TEST_ARGS: ''
664 665 666
  before_script:
    - dnf install -y clang-analyzer findutils
  after_script:
667 668
    - 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
669 670 671
    - echo "Check scan-build results"
    - /bin/false

Benjamin Tissoires's avatar
Benjamin Tissoires committed
672 673 674 675
# 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.

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

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

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

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

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

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

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

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

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

# Python checks, only run on Fedora

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

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

Peter Hutterer's avatar
Peter Hutterer committed
760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775

#
# coverity run
#
# This requires the COVERITY_SCAN_TOKEN. Log into scan.coverity.com and get
# the token from the respective project settings page.
# Schedule a pipeline and set a variable COVERITY_SCAN_TOKEN with the token value.
# https://gitlab.freedesktop.org/$CI_PROJECT_PATH/-/pipeline_schedules
# Email from coverity will be sent to the GITLAB_USER_EMAIL that scheduled the
# job.
#
# Coverity ratelimits submissions and the coverity tools download is about
# 700M, do not run this too often.
#
coverity:
  extends:
776
    - .fdo.distribution-image@debian
Peter Hutterer's avatar
Peter Hutterer committed
777 778 779
    - .policy
  stage: build
  variables:
780 781
    FDO_DISTRIBUTION_VERSION: 'stable'
    FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
782 783
    # so git-describe works, or should work
    GIT_DEPTH: 200
Peter Hutterer's avatar
Peter Hutterer committed
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
  only:
    variables:
      - $COVERITY_SCAN_TOKEN
  script:
    - curl https://scan.coverity.com/download/linux64
        -o /tmp/cov-analysis-linux64.tgz
        --form project=$CI_PROJECT_NAME
        --form token=$COVERITY_SCAN_TOKEN
    - tar xfz /tmp/cov-analysis-linux64.tgz
    # coverity has special build options in meson, make sure we enable those
    - meson coverity-build -Ddocumentation=false -Dcoverity=true
    - cov-analysis-linux64-*/bin/cov-build --dir cov-int  ninja -C coverity-build
    - tar cfz cov-int.tar.gz cov-int
    - curl https://scan.coverity.com/builds?project=$CI_PROJECT_NAME
        --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
        --form file=@cov-int.tar.gz --form version="$(git describe --tags)"
        --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
801 802 803 804 805 806
  artifacts:
    name: "coverity-submit-data"
    when: always
    expire_in: 1 week
    paths:
      - cov-int.tar.gz
Peter Hutterer's avatar
Peter Hutterer committed
807
  needs:
808
    - "debian:stable@container-prep"
Peter Hutterer's avatar
Peter Hutterer committed
809

810 811 812 813 814
#################################################################
#                                                               #
#                        distro stage                           #
#                                                               #
#################################################################
Benjamin Tissoires's avatar
Benjamin Tissoires committed
815

816 817 818 819
fedora:31@default-build:
  stage: distro
  extends:
    - .build@template
820
    - .fdo.distribution-image@fedora
821
  variables:
822 823
    FDO_DISTRIBUTION_VERSION: '31'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
824 825
  needs:
    - "fedora:31@container-prep"
826

Benjamin Tissoires's avatar
Benjamin Tissoires committed
827

828 829 830 831 832 833 834 835
fedora:32@default-build:
  stage: distro
  extends:
    - .build@template
    - .fdo.distribution-image@fedora
  variables:
    FDO_DISTRIBUTION_VERSION: '32'
    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
836 837
  needs:
    - "fedora:32@container-prep"
838 839


840 841 842 843 844 845 846 847 848 849 850 851
debian:stable@default-build:
  stage: distro
  extends:
    - .build@template
    - .fdo.distribution-image@debian
  variables:
    FDO_DISTRIBUTION_VERSION: 'stable'
    FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
  needs:
    - "debian:stable@container-prep"


852 853 854 855 856 857 858 859 860 861 862 863 864
ubuntu:20.04@default-build:
  stage: distro
  extends:
    - .build@template
    - .fdo.distribution-image@ubuntu
  variables:
    FDO_DISTRIBUTION_VERSION: '20.04'
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
  needs:
    - "ubuntu:20.04@container-prep"


ubuntu:20.10@default-build:
865
  stage: distro
866
  extends:
867
    - .build@template
868
    - .fdo.distribution-image@ubuntu
Benjamin Tissoires's avatar
Benjamin Tissoires committed
869
  variables:
870
    FDO_DISTRIBUTION_VERSION: '20.10'
871
    FDO_DISTRIBUTION_TAG: $UBUNTU_TAG
872
  needs:
873
    - "ubuntu:20.10@container-prep"
Benjamin Tissoires's avatar
Benjamin Tissoires committed
874

875 876

arch:rolling@default-build:
Peter Hutterer's avatar
Peter Hutterer committed
877
  stage: distro
878 879
  extends:
    - .build@template
880
    - .fdo.distribution-image@arch
881
  variables:
882 883
    FDO_DISTRIBUTION_VERSION: 'rolling'
    FDO_DISTRIBUTION_TAG: $ARCH_TAG
884 885
  needs:
    - "arch:rolling@container-prep"
886

887

888
alpine:latest@default-build:
889
  stage: distro
890 891
  extends:
    - .build@template
892
    - .fdo.distribution-image@alpine
</