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