Debian Codegraph @

.gitlab-ci/ci.template

raw
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 c6aeb16f86e32525fa630fb99c66c4f3e62fc3cb
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 workflow:
52 rules:
53 # do not duplicate pipelines on merge pipelines
54 - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push"
55 when: never
56 # merge pipeline
57 - if: &is-merge-attempt $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"
58 variables:
59 FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
60 FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
61 FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
62 # post-merge pipeline
63 - if: &is-post-merge $GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "push"
64 variables:
65 FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: priority:high
66 FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: priority:high-kvm
67 FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: priority:high-aarch64
68 # Pre-merge pipeline
69 - if: &is-pre-merge $CI_PIPELINE_SOURCE == "merge_request_event"
70 # Push to a branch on a fork
71 - if: $CI_COMMIT_BRANCH
72
73 stages:
74 - sanity check # CI/commit checks
75 - prep # prep work like rebuilding the container images if there is a change
76 - build # for actually building and testing things in a container
77 - test-suite # for running the test suite in a VM
78 - test-suite-no-libwacom # for running the test suite in a VM (libwacom disabled)
79 - valgrind # for running the test suite under valgrind in a VM
80 - distro # distribs test
81 - deploy # trigger wayland's website generation
82 - container_clean # clean up unused container images (scheduled jobs only)
83
84 variables:
85 ###############################################################################
86 # This is the list of packages required to build libinput with the default #
87 # configuration. #
88 # #
89 # Run dnf install/apt-get install/.. with the list of packages for your #
90 # distribution #
91 # #
92 # See the documentation here: #
93 # https://wayland.freedesktop.org/libinput/doc/latest/building.html #
94 ###############################################################################
95 {% for distro in distributions %}
96 {{"%-17s" | format(distro.name.upper() + '_PACKAGES:')}} '{{ distro.packages|join(' ')}}'
97 {% endfor %}
98 ############################ end of package lists #############################
99
100 # these tags should be updated each time the list of packages is updated
101 # changing these will force rebuilding the associated image
102 # Note: these tags have no meaning and are not tied to a particular
103 # libinput version
104 {% for distro in distributions %}
105 {{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}'
106 {% endfor %}
107
108 FDO_UPSTREAM_REPO: libinput/libinput
109
110 MESON_BUILDDIR: "build dir"
111 NINJA_ARGS: ''
112 MESON_ARGS: ''
113 MESON_TEST_ARGS: '--no-suite=hardware'
114
115 # udev isn't available/working properly in the containers
116 UDEV_NOT_AVAILABLE: 1
117 GIT_DEPTH: 1
118
119 # Default priority for non-merge pipelines
120 FDO_RUNNER_JOB_PRIORITY_TAG_X86_64: "" # Empty tags are ignored by gitlab
121 FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM: kvm
122 FDO_RUNNER_JOB_PRIORITY_TAG_AARCH64: aarch64
123
124 .policy:
125 retry:
126 max: 2
127 when:
128 - runner_system_failure
129 - stuck_or_timeout_failure
130 # cancel run when a newer version is pushed to the branch
131 interruptible: true
132 dependencies: []
133
134 .policy-retry-on-failure:
135 retry:
136 max: 1
137 when:
138 - runner_system_failure
139 - stuck_or_timeout_failure
140 # cancel run when a newer version is pushed to the branch
141 interruptible: true
142 dependencies: []
143
144 .default_artifacts:
145 artifacts:
146 name: "meson-logs-$CI_JOB_NAME"
147 when: always
148 expire_in: 1 week
149 paths:
150 - $MESON_BUILDDIR/meson-logs
151 - $MESON_BUILDDIR/valgrind.*.log
152 reports:
153 junit: $MESON_BUILDDIR/*junit*.xml
154
155 .fdo-runner-tags:
156 tags:
157 - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64
158
159
160 #################################################################
161 # #
162 # sanity check stage #
163 # #
164 #################################################################
165
166 fail-if-fork-is-not-public:
167 extends:
168 - .fdo-runner-tags
169 stage: sanity check
170 script:
171 - |
172 if [ $CI_PROJECT_VISIBILITY != "public" ]; then
173 echo "*************************************************************************************"
174 echo "Project visibility must be set to 'public'"
175 echo "Change this in $CI_PROJECT_URL/edit under 'Visibility, project features, permissions'"
176 echo "*************************************************************************************"
177 exit 1
178 fi
179 except:
180 - main@libinput/libinput
181
182 # Re-generate the CI script and make sure it's the one currently checked in
183 # If this job fails, re-generate the gitlab-ci.yml script, see
184 # $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
185 #
186 check-ci-script:
187 extends:
188 - .fdo.ci-fairy
189 - .fdo-runner-tags
190 stage: sanity check
191 script:
192 - ci-fairy generate-template --verify && exit 0 || true
193 - >
194 printf "%s\n" \
195 "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify" \
196 "https://wayland.freedesktop.org/libinput/doc/latest/contributing.html"
197 - exit 1
198
199 #
200 # Verify that commit messages are as expected, etc.
201 #
202
203 check-commit:
204 extends:
205 - .fdo.ci-fairy
206 - .fdo-runner-tags
207 stage: sanity check
208 script:
209 - ci-fairy -vv check-commits --junit-xml=results.xml && exit 0 || true
210 - >
211 printf "%s\n" \
212 "Error checking commit format. Please verify" \
213 "https://wayland.freedesktop.org/libinput/doc/latest/contributing.html"
214 - exit 1
215 except:
216 - main@libinput/libinput
217 variables:
218 GIT_DEPTH: 100
219 artifacts:
220 reports:
221 junit: results.xml
222
223
224 #
225 # Check for trailing whitespaces
226 #
227
228 check-whitespace:
229 extends:
230 - .fdo.ci-fairy
231 - .fdo-runner-tags
232 stage: sanity check
233 script:
234 - .gitlab-ci/whitespace-check.py $(git ls-files)
235
236 #
237 # pre-commit hooks
238 #
239
240 pre-commit-hooks:
241 extends:
242 - .fdo.ci-fairy
243 - .fdo-runner-tags
244 stage: sanity check
245 script:
246 - python3 -m venv venv
247 - source venv/bin/activate
248 - pip3 install pre-commit
249 - pre-commit run --all-files
250 - git diff --exit-code || (echo "ERROR - Code style errors found, please fix" && false)
251
252 #################################################################
253 # #
254 # prep stage #
255 # #
256 #################################################################
257
258 {% for distro in distributions %}
259 {% for version in distro.versions %}
260 {{distro.name}}:{{version}}@container-prep:
261 extends:
262 {% if distro.qemu_based %}
263 - .fdo.qemu-build@{{distro.name}}
264 {% else %}
265 - .fdo.container-build@{{distro.name}}
266 {% endif %}
267 - .policy
268 - .fdo-runner-tags
269 {% if distro.qemu_based %}
270 tags:
271 - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
272 {% endif %}
273 stage: prep
274 variables:
275 GIT_STRATEGY: none
276 FDO_DISTRIBUTION_VERSION: '{{version}}'
277 FDO_DISTRIBUTION_PACKAGES: ${{distro.name.upper()}}_PACKAGES
278 FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
279
280 {% endfor %}
281 {% endfor %}
282
283
284 #################################################################
285 # #
286 # container clean stage #
287 # run during the clean stage #
288 # #
289 #################################################################
290
291 #
292 # This stage will look for the container images we currently have in
293 # the registry and will remove any that are not tagged with the provided
294 # $container_image:$tag
295 #
296 .container-clean:
297 extends:
298 - .policy
299 - .fdo.ci-fairy
300 - .fdo-runner-tags
301 stage: container_clean
302 script:
303 # Go to your Profile, Settings, Access Tokens
304 # Create a personal token with 'api' scope, copy the value.
305 # Go to CI/CD, Schedules, schedule a new monthly job (or edit the existing one)
306 # Define a variable of type File named AUTHFILE. Content is that token
307 # value.
308 - ci-fairy -v --authfile $AUTHFILE delete-image
309 --repository $FDO_DISTRIBUTION_NAME/$FDO_DISTRIBUTION_VERSION
310 --exclude-tag $FDO_DISTRIBUTION_TAG
311 allow_failure: true
312 only:
313 - schedules
314
315 {% for distro in distributions %}
316 {% for version in distro.versions %}
317 {{distro.name}}:{{version}}@container-clean:
318 extends:
319 - .policy
320 - .container-clean
321 variables:
322 GIT_STRATEGY: none
323 CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/{{distro.name}}/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
324 FDO_DISTRIBUTION_VERSION: '{{version}}'
325 FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
326
327 {% endfor %}
328 {% endfor %}
329
330 #################################################################
331 # #
332 # build stage #
333 # #
334 #################################################################
335
336 .build@template:
337 extends:
338 - .policy
339 - .default_artifacts
340 - .fdo-runner-tags
341 stage: build
342 script:
343 - .gitlab-ci/meson-build.sh
344
345
346 # Run meson and meson test in the container image through qemu
347 .build-in-vng@template:
348 extends:
349 - .policy
350 - .default_artifacts
351 tags:
352 - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
353 variables:
354 MESON_BUILDDIR: build_dir
355 VNG_KERNEL: {{ vng.kernel }}
356 script:
357 # first build in the host container
358 - .gitlab-ci/meson-build.sh --skip-test
359
360 - mkdir -p $MESON_BUILDDIR
361 - curl -LO $VNG_KERNEL
362
363 - export -p > .vngenv
364
365 # runs the test suite only
366 - |
367 vng --run ./bzImage \
368 --user root \
369 --overlay-rwdir=$HOME \
370 --append HOME=$HOME \
371 --overlay-rwdir=$(pwd) \
372 --rwdir=$MESON_BUILDDIR \
373 --exec "source $PWD/.vngenv; rm $PWD/.vngenv; .gitlab-ci/meson-build.sh --skip-setup --skip-build --run-test"
374
375 #
376 # Fedora
377 #
378
379 .check_tainted: &check_tainted |
380 # make sure the kernel is not tainted
381 if [[ "$(ssh localhost -p 5555 cat /proc/sys/kernel/tainted)" -gt 0 ]];
382 then
383 echo tainted kernel ;
384 exit 1 ;
385 fi
386
387 # Run meson and meson test in the qemu image
388 .build-in-qemu@template:
389 extends:
390 - .policy
391 tags:
392 - $FDO_RUNNER_JOB_PRIORITY_TAG_X86_64_KVM
393 variables:
394 MESON_BUILDDIR: build_dir
395 script:
396 # start our vm, no args required
397 - /app/vmctl start || (echo "Error - Failed to start the VM." && exit 1)
398
399 - *check_tainted
400
401 - "scp -r $PWD vm:"
402 - echo "CI_JOB_ID=\"$CI_JOB_ID\"" > sshenv
403 - echo "CI_JOB_NAME=\"$CI_JOB_NAME\"" >> sshenv
404 - echo "MESON_ARGS=\"$MESON_ARGS\"" >> sshenv
405 - echo "MESON_BUILDDIR=\"$MESON_BUILDDIR\"" >> sshenv
406 - echo "MESON_TEST_ARGS=\"$MESON_TEST_ARGS\"" >> sshenv
407 - echo "NINJA_ARGS=\"$NINJA_ARGS\"" >> sshenv
408 - "scp sshenv vm:~/$CI_PROJECT_NAME/.meson_environment"
409 - /app/vmctl exec "cd $CI_PROJECT_NAME ; .gitlab-ci/meson-build.sh" && touch .success || true
410 # no matter the results of the tests, we want to fetch the logs
411 - scp -r vm:$CI_PROJECT_NAME/$MESON_BUILDDIR .
412
413 - *check_tainted
414
415 - /app/vmctl stop
416
417 - if [[ ! -e .success ]] ;
418 then
419 exit 1 ;
420 fi
421 artifacts:
422 name: "qemu-meson-logs-$CI_JOB_NAME"
423 when: always
424 expire_in: 1 week
425 paths:
426 - $MESON_BUILDDIR/meson-logs
427 - console.out
428 reports:
429 junit: $MESON_BUILDDIR/*junit*.xml
430
431
432 # Run in a test suite. Special variables:
433 # - SUITES: the meson test suites to run, or
434 # - SUITE_NAMES: all elements will be expanded to libinput-test-suite-$value
435 # Set one or the other, not both.
436 .test-suite-vm:
437 extends:
438 - .build-in-vng@template
439 stage: test-suite
440 variables:
441 # remove the global --no-suite=hardware
442 MESON_TEST_ARGS: ''
443 LITEST_JOBS: 4
444 before_script:
445 - if ! [[ -z $SUITE_NAMES ]]; then SUITES=$(echo $SUITE_NAMES | sed 's/\([^ ]*\)/libinput-test-suite-\1/g'); fi
446 - echo "Testing $SUITES"
447 - export MESON_TEST_ARGS="$MESON_TEST_ARGS $SUITES"
448
449
450 {# qemu tests are only done for the latest version of any distribution #}
451 {% for distro in distributions if distro.use_for_qemu_tests %}
452 {% set version = "{}".format(distro.versions|last()) %}
453 .{{distro.name}}:{{version}}@test-suite-vm:
454 extends:
455 - .fdo.distribution-image@{{distro.name}}
456 - .test-suite-vm
457 variables:
458 FDO_DISTRIBUTION_VERSION: {{version}}
459 FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
460 needs:
461 - "{{distro.name}}:{{version}}@container-prep"
462
463
464 {% for suite in test_suites %}
465 vm-{{suite.name}}:
466 extends:
467 - .{{distro.name}}:{{version}}@test-suite-vm
468 variables:
469 SUITE_NAMES: '{{suite.suites|join(' ')}}'
470
471 vm-{{suite.name}}-no-libwacom:
472 extends:
473 - vm-{{suite.name}}
474 stage: test-suite-no-libwacom
475 variables:
476 MESON_ARGS: '-Dlibwacom=false'
477
478 {% endfor %}
479
480 {% for suite in test_suites %}
481 vm-valgrind-{{suite.name}}:
482 stage: valgrind
483 extends:
484 - vm-{{suite.name}}
485 - .policy-retry-on-failure
486 variables:
487 MESON_TEST_ARGS: '--setup=valgrind'
488 LITEST_JOBS: 0
489 retry:
490 max: 2
491 rules:
492 - if: $GITLAB_USER_LOGIN != "marge-bot"
493
494 {% endfor %}
495
496 {% endfor %}{# for if distro.use_for_qemu_tests #}
497
498 {% for distro in distributions if distro.use_for_custom_build_tests %}
499 {% set version = "{}".format(distro.versions|last()) %}
500 .{{distro.name}}-build@template:
501 extends:
502 - .fdo.distribution-image@{{distro.name}}
503 - .build@template
504 variables:
505 FDO_DISTRIBUTION_VERSION: '{{version}}'
506 FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
507 needs:
508 - "{{distro.name}}:{{version}}@container-prep"
509
510 default-build-release@{{distro.name}}:{{version}}:
511 stage: distro
512 extends:
513 - .{{distro.name}}-build@template
514 variables:
515 MESON_ARGS: "-Dbuildtype=release"
516 CFLAGS: "-Werror"
517
518 clang-tidy@{{distro.name}}:{{version}}:
519 extends:
520 - .{{distro.name}}-build@template
521 variables:
522 NINJA_ARGS: ''
523 MESON_TEST_ARGS: ''
524 CC: 'clang'
525 script:
526 - .gitlab-ci/meson-build.sh
527 - ninja -C "$MESON_BUILDDIR" clang-tidy
528
529 # Below jobs are build option combinations. We only
530 # run them on one image, they shouldn't fail on one distro
531 # when they succeed on another.
532
533 build-no-libwacom@{{distro.name}}:{{version}}:
534 extends:
535 - .{{distro.name}}-build@template
536 variables:
537 MESON_ARGS: "-Dlibwacom=false"
538
539 build-no-libwacom-nodeps@{{distro.name}}:{{version}}:
540 extends:
541 - .{{distro.name}}-build@template
542 variables:
543 MESON_ARGS: "-Dlibwacom=false"
544 before_script:
545 - dnf remove -y libwacom libwacom-devel
546
547 build-no-mtdev@{{distro.name}}:{{version}}:
548 extends:
549 - .{{distro.name}}-build@template
550 variables:
551 MESON_ARGS: "-Dmtdev=false"
552
553 build-no-mtdev-nodeps@{{distro.name}}:{{version}}:
554 extends:
555 - .{{distro.name}}-build@template
556 variables:
557 MESON_ARGS: "-Dmtdev=false"
558 before_script:
559 - dnf remove -y mtdev mtdev-devel
560
561 build-no-lua@{{distro.name}}:{{version}}:
562 extends:
563 - .{{distro.name}}-build@template
564 variables:
565 MESON_ARGS: "-Dlua-plugins=disabled"
566
567 build-no-lua-nodeps@{{distro.name}}:{{version}}:
568 extends:
569 - .{{distro.name}}-build@template
570 variables:
571 MESON_ARGS: "-Dlua-plugins=disabled"
572 before_script:
573 - dnf remove -y lua lua-devel
574
575 build-docs@{{distro.name}}:{{version}}:
576 extends:
577 - .{{distro.name}}-build@template
578 variables:
579 MESON_ARGS: "-Ddocumentation=true"
580
581 build-no-docs-nodeps@{{distro.name}}:{{version}}:
582 extends:
583 - .{{distro.name}}-build@template
584 variables:
585 MESON_ARGS: "-Ddocumentation=false"
586 before_script:
587 - dnf remove -y doxygen graphviz
588
589 build-no-debuggui@{{distro.name}}:{{version}}:
590 extends:
591 - .{{distro.name}}-build@template
592 variables:
593 MESON_ARGS: "-Ddebug-gui=false"
594
595 build-no-debuggui-nodeps@{{distro.name}}:{{version}}:
596 extends:
597 - .{{distro.name}}-build@template
598 variables:
599 MESON_ARGS: "-Ddebug-gui=false"
600 before_script:
601 - dnf remove -y gtk3-devel gtk4-devel
602
603 build-no-tests@{{distro.name}}:{{version}}:
604 extends:
605 - .{{distro.name}}-build@template
606 variables:
607 MESON_ARGS: "-Dtests=false"
608
609 build-no-tests-nodeps@{{distro.name}}:{{version}}:
610 extends:
611 - .{{distro.name}}-build@template
612 variables:
613 MESON_ARGS: "-Dtests=false"
614 before_script:
615 - dnf remove -y check-devel
616
617 valgrind@{{distro.name}}:{{version}}:
618 extends:
619 - .{{distro.name}}-build@template
620 variables:
621 MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
622
623 # Python checks, only run on Fedora
624
625 usr-bin-env-python@{{distro.name}}:{{version}}:
626 extends:
627 - .{{distro.name}}-build@template
628 script:
629 - |
630 if git grep -l '^#!/usr/bin/python'; then
631 echo "Use '/usr/bin/env python3' in the above files";
632 /bin/false
633 fi
634
635 # A job to check we're actually running all test suites in the CI
636 check-test-suites:
637 extends:
638 - .{{distro.name}}-build@template
639 script:
640 - meson setup builddir
641 - meson introspect builddir --test | jq -r '.[].name' | grep 'libinput-test-suite' | sort > meson-testsuites
642 - |
643 cat <<EOF > ci-testsuites ;
644 {% for suite in test_suites %}
645 {% for name in suite.suites %}
646 libinput-test-suite-{{name}}
647 {% endfor %}
648 {% endfor %}
649 EOF
650 - sort -o ci-testsuites ci-testsuites
651 - diff -u8 -w ci-testsuites meson-testsuites || (echo "Some test suites are not run in the CI" && false)
652 only:
653 changes:
654 - "meson.build"
655 - ".gitlab-ci.yml"
656 {% endfor %}
657
658 #
659 # coverity run
660 #
661 # This requires the COVERITY_SCAN_TOKEN. Log into scan.coverity.com and get
662 # the token from the respective project settings page.
663 # Schedule a pipeline and set a variable COVERITY_SCAN_TOKEN with the token value.
664 # https://gitlab.freedesktop.org/$CI_PROJECT_PATH/-/pipeline_schedules
665 # Email from coverity will be sent to the GITLAB_USER_EMAIL that scheduled the
666 # job.
667 #
668 # Coverity ratelimits submissions and the coverity tools download is about
669 # 700M, do not run this too often.
670 #
671 coverity:
672 extends:
673 - .fdo.distribution-image@debian
674 - .policy
675 - .fdo-runner-tags
676 stage: build
677 variables:
678 FDO_DISTRIBUTION_VERSION: 'stable'
679 FDO_DISTRIBUTION_TAG: $DEBIAN_TAG
680 # so git-describe works, or should work
681 GIT_DEPTH: 200
682 only:
683 variables:
684 - $COVERITY_SCAN_TOKEN
685 script:
686 - curl https://scan.coverity.com/download/linux64
687 -o /tmp/cov-analysis-linux64.tgz
688 --form project=$CI_PROJECT_NAME
689 --form token=$COVERITY_SCAN_TOKEN
690 - tar xfz /tmp/cov-analysis-linux64.tgz
691 # coverity has special build options in meson, make sure we enable those
692 - meson coverity-build -Ddocumentation=false -Dcoverity=true
693 - cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C coverity-build
694 - tar cfz cov-int.tar.gz cov-int
695 - curl https://scan.coverity.com/builds?project=$CI_PROJECT_NAME
696 --form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
697 --form [email protected] --form version="$(git describe --tags)"
698 --form description="$(git describe --tags) / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
699 artifacts:
700 name: "coverity-submit-data"
701 when: always
702 expire_in: 1 week
703 paths:
704 - cov-int.tar.gz
705 needs:
706 - "debian:stable@container-prep"
707
708 #################################################################
709 # #
710 # distro stage #
711 # #
712 #################################################################
713
714 {% for distro in distributions %}
715 {% if not distro.qemu_based %}
716 {% for version in distro.versions %}
717 {{distro.name}}:{{version}}@default-build:
718 stage: distro
719 extends:
720 - .build@template
721 - .fdo.distribution-image@{{distro.name}}
722 variables:
723 FDO_DISTRIBUTION_VERSION: '{{version}}'
724 FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
725 {# Where we have extra_variables defined, add them to the list #}
726 {% if distro.build is defined and distro.build.extra_variables is defined %}
727 {% for var in distro.build.extra_variables %}
728 {{var}}
729 {% endfor %}
730 {% endif %}
731 needs:
732 - "{{distro.name}}:{{version}}@container-prep"
733
734
735 {% endfor %}
736 {% else %}
737 {% set version = "{}".format(distro.versions|last()) %}
738 {{distro.name}}:{{version}}@default-build:
739 stage: distro
740 extends:
741 - .build-in-qemu@template
742 - .fdo.distribution-image@{{distro.name}}
743 variables:
744 FDO_DISTRIBUTION_VERSION: '{{version}}'
745 FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
746 {# Where we have extra_variables defined, add them to the list #}
747 {% if distro.build is defined and distro.build.extra_variables is defined %}
748 {% for var in distro.build.extra_variables %}
749 {{var}}
750 {% endfor %}
751 {% endif %}
752 needs:
753 - "{{distro.name}}:{{version}}@container-prep"
754
755 {% endif %}
756 {% endfor %}
757
758 #################################################################
759 # #
760 # deploy stage #
761 # #
762 #################################################################
763
764 {% for distro in distributions if distro.name == "fedora" %}
765 {% set version = "{}".format(distro.versions|last()) %}
766 build rpm:
767 extends:
768 - .fdo.distribution-image@fedora
769 - .policy
770 - .fdo-runner-tags
771 stage: deploy
772 variables:
773 FDO_DISTRIBUTION_VERSION: '{{version}}'
774 FDO_DISTRIBUTION_TAG: $FEDORA_TAG
775 needs:
776 - "fedora:{{version}}@container-prep"
777 script:
778 - meson "$MESON_BUILDDIR"
779 - VERSION=$(meson introspect "$MESON_BUILDDIR" --projectinfo | jq -r .version)
780 - sed -e "s/@PIPELINEID@/${CI_PIPELINE_ID}/"
781 -e "s/@GITVERSION@/${CI_COMMIT_SHA}/"
782 -e "s/@VERSION@/${VERSION}/" .gitlab-ci/libinput.spec.in > libinput.spec
783 - git config --local user.name 'gitlab CI'
784 - git config --local user.email 'noreply@nowhere'
785 - git add libinput.spec && git commit -m 'Add libinput.spec for build testing' libinput.spec
786 - cd "$MESON_BUILDDIR"
787 - meson dist --no-test
788 - rpmbuild -ta meson-dist/libinput*.tar.xz
789 {% endfor %}
790
791
792 wayland-web:
793 stage: deploy
794 trigger: wayland/wayland.freedesktop.org
795 variables:
796 MESON_ARGS: '-Ddocumentation=true -Ddebug-gui=false -Dlibwacom=false -Dtests=false'
797 MESON_BUILDDIR: 'builddir'
798 rules:
799 - if: '$CI_PIPELINE_SOURCE == "schedule"'
800 when: never
801 - if: '$CI_COMMIT_BRANCH == "main" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_PROJECT_PATH == $FDO_UPSTREAM_REPO'
802 when: on_success
803 - when: never