gitlab CI: check commits/CI template generation before spinning up containers
[platform/upstream/libinput.git] / .gitlab-ci / ci.template
1 # vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
2
3 {# You're looking at the template here, so you can ignore the below
4    warning. This is the right file to edit #}
5 ########################################
6 #                                      #
7 # THIS FILE IS GENERATED, DO NOT EDIT  #
8 #                                      #
9 ########################################
10
11 # This is a bit complicated for two reasons:
12 # - we really want to run dnf/apt/... only once, updating on the test runner for
13 #   each job takes forever. So we create a container image for each distribution
14 #   tested, then run the tests on this container image.
15 #
16 #   This is handled by the ci-templates, ensuring containers are only rebuilt
17 #   when the TAG changes.
18 #
19 # - GitLab only allows one script: set per job but we have a bunch of commands
20 #   we need to re-run for each build (meson && ninja && etc). YAML cannot merge
21 #   arrays so we're screwed.
22 #
23 #   So instead we use a default_build template and override everything with
24 #   variables. The only two variables that matter:
25 #     MESON_ARGS=-Denable-something=true
26 #     NINJA_ARGS=dist ... to run 'ninja -C builddir dist'
27 #   Note that you cannot use scripts: in any target if you expect default_build
28 #   to work.
29 #
30 #
31 # All jobs must follow the naming scheme of
32 # <distribution>:<version>@activity:
33 #  e.g. fedora:31@build-default
34
35 .templates_sha: &template_sha 16f790f93f893394b70d7048fb0e8a981ceaa3c5 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
36
37 include:
38   {% for distro in distributions|sort(attribute="name") %}
39   {% if not distro.does_not_have_ci_templates %}
40   # {{ distro.name.capitalize() }} container builder template
41   - project: 'freedesktop/ci-templates'
42     ref: *template_sha
43     file: '/templates/{{distro.name}}.yml'
44   {% endif %}
45   {% endfor %}
46   - project: 'freedesktop/ci-templates'
47     ref: *template_sha
48     file: '/templates/ci-fairy.yml'
49
50 stages:
51   - sanity check     # CI/commit checks
52   - prep             # prep work like rebuilding the container images if there is a change
53   - build            # for actually building and testing things in a container
54   - VM               # for running the test suite in a VM
55   - valgrind         # for running the test suite under valgrind in a VM
56   - distro           # distribs test
57   - deploy           # trigger wayland's website generation
58   - container_clean  # clean up unused container images (scheduled jobs only)
59
60 variables:
61   ###############################################################################
62   # This is the list of packages required to build libinput with the default    #
63   # configuration.                                                              #
64   #                                                                             #
65   # Run dnf install/apt-get install/.. with the list of packages for your       #
66   # distribution                                                                #
67   #                                                                             #
68   # See the documentation here:                                                 #
69   # https://wayland.freedesktop.org/libinput/doc/latest/building_libinput.html  #
70   ###############################################################################
71 {% for distro in distributions %}
72   {{"%-17s" | format(distro.name.upper() + '_PACKAGES:')}} '{{ distro.packages|join(' ')}}'
73 {% endfor %}
74   FREEBSD_BUILD_PKGS: 'meson'
75   ############################ end of package lists #############################
76
77   # these tags should be updated each time the list of packages is updated
78   # changing these will force rebuilding the associated image
79   # Note: these tags have no meaning and are not tied to a particular
80   # libinput version
81 {% for distro in distributions %}
82   {{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}'
83 {% endfor %}
84 {% for distro in distributions %}
85 {% if distro.want_qemu %}
86   QEMU_TAG:    'qemu-vm-{{distro.tag}}'
87 {% endif %}
88 {% endfor %}
89
90   FREEBSD_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/freebsd/11.2:$FREEBSD_TAG
91   FDO_UPSTREAM_REPO: libinput/libinput
92
93   MESON_BUILDDIR: "build dir"
94   NINJA_ARGS: ''
95   MESON_ARGS: ''
96   MESON_TEST_ARGS: '--no-suite=hardware'
97
98   # udev isn't available/working properly in the containers
99   UDEV_NOT_AVAILABLE: 1
100   GIT_DEPTH: 1
101
102 .policy:
103   retry:
104     max: 2
105     when:
106       - runner_system_failure
107       - stuck_or_timeout_failure
108   # cancel run when a newer version is pushed to the branch
109   interruptible: true
110
111 .default_artifacts:
112   artifacts:
113     name: "meson-logs-$CI_JOB_NAME"
114     when: always
115     expire_in: 1 week
116     paths:
117       - $MESON_BUILDDIR/meson-logs
118     reports:
119       junit: $MESON_BUILDDIR/junit-*.xml
120
121
122 #################################################################
123 #                                                               #
124 #                     sanity check stage                        #
125 #                                                               #
126 #################################################################
127
128 # Re-generate the CI script and make sure it's the one currently checked in
129 # If this job fails, re-generate the gitlab-ci.yml script, see
130 # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
131 #
132 check-ci-script:
133   extends:
134     - .fdo.ci-fairy
135   stage: sanity check
136   script:
137     - ci-fairy generate-template --verify && exit 0 || true
138     - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
139     - exit 1
140
141 #
142 # Verify that commit messages are as expected, signed-off, etc.
143 #
144
145 check-commit:
146   extends:
147     - .fdo.ci-fairy
148   stage: sanity check
149   script:
150     - ci-fairy check-commits --signed-off-by --junit-xml=results.xml
151   except:
152     - master@libinput/libinput
153   variables:
154     GIT_DEPTH: 100
155   artifacts:
156     reports:
157       junit: results.xml
158
159 #################################################################
160 #                                                               #
161 #                          prep stage                           #
162 #                                                               #
163 #################################################################
164
165 #
166 # Note: images are rebuilt weekly with a scheduled pipeline with FDO_FORCE_REBUILD set
167 #
168 #
169 {# qemu builds are only done for the latest version of any distribution #}
170 {% for distro in distributions if distro.want_qemu %}
171 {% set version = "{}".format(distro.versions|last()) %}
172 {{distro.name}}:{{version}}@qemu-prep:
173   extends:
174     - .fdo.qemu-build@{{distro.name}}
175     - .policy
176   stage: prep
177   tags:
178     - kvm
179   variables:
180     GIT_STRATEGY: none
181     FDO_DISTRIBUTION_VERSION: {{version}}
182     FDO_DISTRIBUTION_TAG: $QEMU_TAG
183     FDO_DISTRIBUTION_PACKAGES: ${{distro.name.upper()}}_PACKAGES
184   allow_failure: true
185 {% endfor %}
186
187 {% for distro in distributions %}
188 {% for version in distro.versions %}
189 {{distro.name}}:{{version}}@container-prep:
190   extends:
191     - .fdo.container-build@{{distro.name}}
192     - .policy
193   stage: prep
194   variables:
195     GIT_STRATEGY: none
196     FDO_DISTRIBUTION_VERSION: '{{version}}'
197     FDO_DISTRIBUTION_PACKAGES: ${{distro.name.upper()}}_PACKAGES
198     FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
199
200 {% endfor %}
201 {% endfor %}
202
203
204 # Note that we want to use the latest buildah image, and for that
205 # we use one of the .fdo.container-build@distribution by replacing the
206 # `script`.
207 .freebsd@container-prep:
208   extends:
209     - .policy
210     - .fdo.container-build@fedora
211   stage: prep
212   script:
213     # log in to the registry
214     - podman login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
215
216     # get the full container image name
217     - export IMAGE=freebsd/$FREEBSD_VERSION:$FREEBSD_TAG
218
219     - if [[ x"$FDO_FORCE_REBUILD" != x ]] ; then touch .rebuild; fi
220
221     # pull the latest upstream image if it exists
222     - test -e .rebuild || skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD
223                                  docker://$CI_REGISTRY/$FDO_UPSTREAM_REPO/$IMAGE
224                                  docker://$CI_REGISTRY_IMAGE/$IMAGE && exit 0 || true ;
225
226     # check if our image is already in the current registry
227     - test -e .rebuild || skopeo inspect docker://$CI_REGISTRY_IMAGE/$IMAGE > /dev/null && exit 0 || true ;
228
229     - export BUILDAH_RUN="buildah run --isolation chroot"
230     - export BUILDAH_COMMIT="buildah commit --format docker"
231     - buildcntr=$(buildah from --quiet  myfreeweb/freebsd-cross:latest)
232     - $BUILDAH_RUN $buildcntr apk add --no-cache $FREEBSD_BUILD_PKGS
233     - $BUILDAH_RUN $buildcntr pkg -r /freebsd update -f
234     - $BUILDAH_RUN $buildcntr pkg -r /freebsd install -y $FREEBSD_PACKAGES
235     - buildah config --workingdir /app $buildcntr
236     # tag the current container
237     - $BUILDAH_COMMIT $buildcntr $FREEBSD_CONTAINER_IMAGE
238     # clean up the working container
239     - buildah rm $buildcntr
240
241     # push the container image to the libinput registry
242     - podman push --quiet $FREEBSD_CONTAINER_IMAGE
243     - skopeo copy --dest-creds $CI_REGISTRY_USER:$CI_REGISTRY_PASSWORD
244         docker://$FREEBSD_CONTAINER_IMAGE
245         docker://$CI_REGISTRY_IMAGE/freebsd/$FREEBSD_VERSION:$CI_JOB_ID
246
247 freebsd:11.2@container-prep:
248   extends:
249     - .freebsd@container-prep
250   variables:
251     GIT_STRATEGY: none
252     FREEBSD_VERSION: "11.2"
253
254
255 #################################################################
256 #                                                               #
257 #                   container clean stage                       #
258 #                 run during the clean stage                    #
259 #                                                               #
260 #################################################################
261
262 #
263 # This stage will look for the container images we currently have in
264 # the registry and will remove any that are not tagged with the provided
265 # $container_image:$tag
266 #
267 .container-clean:
268   extends:
269     - .policy
270     - .fdo.ci-fairy
271   stage: container_clean
272   script:
273     # Go to your Profile, Settings, Access Tokens
274     # Create a personal token with 'api' scope, copy the value.
275     # Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
276     # Define a variable of type File named AUTHFILE. Content is that token
277     # value.
278     - ci-fairy -v --authfile $AUTHFILE delete-image
279             --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
280             --exclude-tag $FDO_DISTRIBUTION_TAG
281   dependencies: []
282   allow_failure: true
283   only:
284     - schedules
285
286 {% for distro in distributions %}
287 {% for version in distro.versions %}
288 {{distro.name}}:{{version}}@container-clean:
289   extends:
290     - .container-clean
291   variables:
292     GIT_STRATEGY: none
293     CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/{{distro.name}}/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
294     FDO_DISTRIBUTION_VERSION: '{{version}}'
295     FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
296
297 {% endfor %}
298 {% endfor %}
299
300 freebsd:11.2@container-clean:
301   extends:
302     - .container-clean
303   variables:
304     GIT_STRATEGY: none
305     CURRENT_CONTAINER_IMAGE: $FREEBSD_CONTAINER_IMAGE
306
307 #################################################################
308 #                                                               #
309 #                       build stage                             #
310 #                                                               #
311 #################################################################
312
313 .build@template:
314   extends:
315     - .policy
316     - .default_artifacts
317   stage: build
318   script:
319     - .gitlab-ci/meson-build.sh
320   dependencies: []
321
322 #
323 # Fedora
324 #
325
326 .check_tainted: &check_tainted |
327   # make sure the kernel is not tainted
328   if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
329   then
330     echo tainted kernel ;
331     exit 1 ;
332   fi
333
334 # Run in a test suite. Special variables:
335 # - SUITES: the meson test suites to run, or
336 # - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
337 # Set one or the other, not both.
338 .test-suite-vm:
339   extends:
340     - .policy
341     - .fdo.distribution-image@fedora
342   stage: VM
343   tags:
344     - kvm
345   variables:
346     MESON_BUILDDIR: build_dir
347     # remove the global --no-suite=hardware
348     MESON_TEST_ARGS: ''
349   before_script:
350     - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
351     - echo "Testing $SUITES"
352   script:
353     # start our vm, no args required
354     - /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
355
356     - *check_tainted
357
358     - "scp -r $PWD vm:"
359     - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
360     - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
361     - echo "MESON_ARGS=\"$MESON_ARGS\"" >> sshenv
362     - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
363     - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS $SUITES\"" >> sshenv
364     - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
365     - "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment"
366     - /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
367     # no matter the results of the tests, we want to fetch the logs
368     - scp -r vm:$CI_PROJECT_NAME/$MESON_BUILDDIR .
369
370     - *check_tainted
371
372     - /app/vmctl stop
373
374     - if [[ ! -e .success ]] ;
375       then
376         exit 1 ;
377       fi
378   artifacts:
379     name: "qemu-meson-logs-$CI_JOB_NAME"
380     when: always
381     expire_in: 1 week
382     paths:
383       - $MESON_BUILDDIR/meson-logs
384       - console.out
385     reports:
386       junit: $MESON_BUILDDIR/junit-*.xml
387
388   allow_failure: true
389   retry:
390     max: 2
391     when: script_failure
392
393
394 {# qemu tests are only done for the latest version of any distribution #}
395 {% for distro in distributions if distro.want_qemu %}
396 {% set version = "{}".format(distro.versions|last()) %}
397 .{{distro.name}}:{{version}}@test-suite-vm:
398   extends:
399     - .test-suite-vm
400   variables:
401     FDO_DISTRIBUTION_VERSION: {{version}}
402     FDO_DISTRIBUTION_TAG: $QEMU_TAG
403   needs:
404     - "{{distro.name}}:{{version}}@qemu-prep"
405
406
407 {% for suite in test_suites %}
408 vm-{{suite.name}}:
409   extends:
410     - .{{distro.name}}:{{version}}@test-suite-vm
411   variables:
412     SUITE_NAMES: '{{suite.suites}}'
413
414 vm-{{suite.name}}-no-libwacom:
415   extends:
416     - vm-{{suite.name}}
417   variables:
418     MESON_ARGS: '-Dlibwacom=false'
419
420 {% endfor %}
421
422 {% for suite in test_suites %}
423 vm-valgrind-{{suite.name}}:
424   stage: valgrind
425   extends:
426     - vm-{{suite.name}}
427   variables:
428     MESON_TEST_ARGS: '--setup=valgrind'
429
430 {% endfor %}
431 {% endfor %}{# for if distro.want_qemu #}
432
433 {% for distro in distributions if distro.use_for_custom_build_tests %}
434 {% set version = "{}".format(distro.versions|last()) %}
435 .{{distro.name}}-build@template:
436   extends:
437     - .fdo.distribution-image@fedora
438     - .build@template
439   variables:
440     FDO_DISTRIBUTION_VERSION: '{{version}}'
441     FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
442   needs:
443     - "{{distro.name}}:{{version}}@container-prep"
444
445 default-build-release@{{distro.name}}:{{version}}:
446   stage: distro
447   extends:
448     - .{{distro.name}}-build@template
449   variables:
450     MESON_ARGS: "-Dbuildtype=release"
451     CFLAGS: "-Werror"
452
453 scan-build@{{distro.name}}:{{version}}:
454   extends:
455     - .{{distro.name}}-build@template
456   variables:
457     NINJA_ARGS: scan-build
458     MESON_TEST_ARGS: ''
459   before_script:
460     - dnf install -y clang-analyzer findutils
461   after_script:
462     - test ! -d "$MESON_BUILDDIR"/meson-logs/scanbuild && exit 0
463     - test $(find "$MESON_BUILDDIR"/meson-logs/scanbuild -maxdepth 0 ! -empty -exec echo "not empty" \; | wc -l) -eq 0 && exit 0
464     - echo "Check scan-build results"
465     - /bin/false
466
467 # Below jobs are build option combinations. We only
468 # run them on one image, they shouldn't fail on one distro
469 # when they succeed on another.
470
471 build-no-libwacom@{{distro.name}}:{{version}}:
472   extends:
473     - .{{distro.name}}-build@template
474   variables:
475     MESON_ARGS: "-Dlibwacom=false"
476
477 build-no-libwacom-nodeps@{{distro.name}}:{{version}}:
478   extends:
479     - .{{distro.name}}-build@template
480   variables:
481     MESON_ARGS: "-Dlibwacom=false"
482   before_script:
483     - dnf remove -y libwacom libwacom-devel
484
485 build-no-docs@{{distro.name}}:{{version}}:
486   extends:
487     - .{{distro.name}}-build@template
488   variables:
489     MESON_ARGS: "-Ddocumentation=false"
490
491 build-no-docs-nodeps@{{distro.name}}:{{version}}:
492   extends:
493     - .{{distro.name}}-build@template
494   variables:
495     MESON_ARGS: "-Ddocumentation=false"
496   before_script:
497     - dnf remove -y doxygen graphviz
498
499 build-no-debuggui@{{distro.name}}:{{version}}:
500   extends:
501     - .{{distro.name}}-build@template
502   variables:
503     MESON_ARGS: "-Ddebug-gui=false"
504
505 build-no-debuggui-nodeps@{{distro.name}}:{{version}}:
506   extends:
507     - .{{distro.name}}-build@template
508   variables:
509     MESON_ARGS: "-Ddebug-gui=false"
510   before_script:
511     - dnf remove -y gtk3-devel
512
513 build-no-tests@{{distro.name}}:{{version}}:
514   extends:
515     - .{{distro.name}}-build@template
516   variables:
517     MESON_ARGS: "-Dtests=false"
518
519 build-no-tests-nodeps@{{distro.name}}:{{version}}:
520   extends:
521     - .{{distro.name}}-build@template
522   variables:
523     MESON_ARGS: "-Dtests=false"
524   before_script:
525     - dnf remove -y check-devel
526
527 valgrind@{{distro.name}}:{{version}}:
528   extends:
529     - .{{distro.name}}-build@template
530   variables:
531     MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
532   before_script:
533     - dnf install -y valgrind
534
535 # Python checks, only run on Fedora
536
537 usr-bin-env-python@{{distro.name}}:{{version}}:
538   extends:
539     - .{{distro.name}}-build@template
540   script:
541     - |
542       if git grep -l '^#!/usr/bin/python'; then
543         echo "Use '/usr/bin/env python3' in the above files";
544         /bin/false
545       fi
546
547 flake8@{{distro.name}}:{{version}}:
548   extends:
549     - .{{distro.name}}-build@template
550   before_script:
551     - dnf install -y python3-flake8
552   script:
553     - flake8-3 --ignore=W501,E501,W504 $(git grep -l '^#!/usr/bin/env python3')
554
555 {% endfor %}
556
557 #
558 # coverity run
559 #
560 # This requires the COVERITY_SCAN_TOKEN. Log into scan.coverity.com and get
561 # the token from the respective project settings page.
562 # Schedule a pipeline and set a variable COVERITY_SCAN_TOKEN with the token value.
563 # https://gitlab.freedesktop.org/$CI_PROJECT_PATH/-/pipeline_schedules
564 # Email from coverity will be sent to the GITLAB_USER_EMAIL that scheduled the
565 # job.
566 #
567 # Coverity ratelimits submissions and the coverity tools download is about
568 # 700M, do not run this too often.
569 #
570 coverity:
571   extends:
572     - .fdo.distribution-image@debian
573     - .policy
574   stage: build
575   variables:
576     FDO_DISTRIBUTION_VERSION: 'stable'
577     FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
578     # so git-describe works, or should work
579     GIT_DEPTH: 200
580   only:
581     variables:
582       - $COVERITY_SCAN_TOKEN
583   script:
584     - curl https://scan.coverity.com/download/linux64
585         -o /tmp/cov-analysis-linux64.tgz
586         --form project=$CI_PROJECT_NAME
587         --form token=$COVERITY_SCAN_TOKEN
588     - tar xfz /tmp/cov-analysis-linux64.tgz
589     # coverity has special build options in meson, make sure we enable those
590     - meson coverity-build -Ddocumentation=false -Dcoverity=true
591     - cov-analysis-linux64-*/bin/cov-build --dir cov-int  ninja -C coverity-build
592     - tar cfz cov-int.tar.gz cov-int
593     - curl https://scan.coverity.com/builds?project=$CI_PROJECT_NAME
594         --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
595         --form file=@cov-int.tar.gz --form version="$(git describe --tags)"
596         --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
597   artifacts:
598     name: "coverity-submit-data"
599     when: always
600     expire_in: 1 week
601     paths:
602       - cov-int.tar.gz
603   needs:
604     - "debian:stable@container-prep"
605
606 #################################################################
607 #                                                               #
608 #                        distro stage                           #
609 #                                                               #
610 #################################################################
611
612 {% for distro in distributions %}
613 {% for version in distro.versions %}
614 {{distro.name}}:{{version}}@default-build:
615   stage: distro
616   extends:
617     - .build@template
618     - .fdo.distribution-image@{{distro.name}}
619   variables:
620     FDO_DISTRIBUTION_VERSION: '{{version}}'
621     FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
622     {# Where we have extra_variables defined, add them to the list #}
623     {% if distro.build is defined and distro.build.extra_variables is defined %}
624     {% for var in distro.build.extra_variables %}
625     {{var}}
626     {% endfor %}
627     {% endif %}
628   needs:
629     - "{{distro.name}}:{{version}}@container-prep"
630
631
632 {% endfor %}
633 {% endfor %}
634
635 #
636 # FreeBSD
637 #
638 .freebsd@template:
639   stage: distro
640   extends:
641     - .build@template
642   image: $FREEBSD_CONTAINER_IMAGE
643   variables:
644     MESON_ARGS: '--cross-file freebsd -Ddocumentation=false -Dtests=false -Depoll-dir=/freebsd/usr/local/'
645     # Can't run FreeBSD tests on Linux machine, so MESON_TEST_ARGS shouldn't be "test"
646     MESON_TEST_ARGS: ''
647
648 freebsd:11.2@default-build:
649   extends:
650     - .freebsd@template
651   needs:
652     - "freebsd:11.2@container-prep"
653
654 #################################################################
655 #                                                               #
656 #                        deploy stage                           #
657 #                                                               #
658 #################################################################
659
660 #
661 # Verify that the merge request has the allow-collaboration checkbox ticked
662 #
663
664 check-merge-request:
665   extends:
666     - .fdo.ci-fairy
667   stage: deploy
668   script:
669     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
670   artifacts:
671     when: on_failure
672     reports:
673       junit: results.xml
674   allow_failure: true
675
676 build rpm:
677   extends:
678     - .fdo.distribution-image@fedora
679     - .policy
680   stage: deploy
681   variables:
682     FDO_DISTRIBUTION_VERSION: '32'
683     FDO_DISTRIBUTION_TAG: $FEDORA_TAG
684   needs:
685     - "fedora:32@container-prep"
686   script:
687     - dnf install -y rpmdevtools jq
688     - meson "$MESON_BUILDDIR"
689     - VERSION=$(meson introspect "$MESON_BUILDDIR" --projectinfo | jq -r .version)
690     - sed -e "s/@PIPELINEID@/${CI_PIPELINE_ID}/"
691           -e "s/@GITVERSION@/${CI_COMMIT_SHA}/"
692           -e "s/@VERSION@/${VERSION}/" .gitlab-ci/libinput.spec.in > libinput.spec
693     - git config --local user.name 'gitlab CI'
694     - git config --local user.email 'noreply@nowhere'
695     - git add libinput.spec && git commit -m 'Add libinput.spec for build testing' libinput.spec
696     - cd "$MESON_BUILDDIR"
697     - meson dist --no-test
698     - rpmbuild -ta meson-dist/libinput*.tar.xz
699
700
701 wayland-web:
702   stage: deploy
703   trigger: wayland/wayland.freedesktop.org
704   except:
705     refs:
706       - schedules
707   variables:
708     MESON_ARGS: '-Ddebug-gui=false -Dlibwacom=false -Dtests=false'
709     MESON_BUILDDIR: 'builddir'
710   only:
711     refs:
712       - master
713     variables:
714       - $CI_PROJECT_PATH == "libinput/libinput"
715