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