1d9d3a8d2Smrg{# You're looking at the template here, so you can ignore the below
2d9d3a8d2Smrg   warning. This is the right file to edit #}
3d9d3a8d2Smrg
4d9d3a8d2Smrg#####################################################
5d9d3a8d2Smrg#                                                   #
6d9d3a8d2Smrg#       THIS FILE IS GENERATED, DO NOT EDIT!        #
7d9d3a8d2Smrg#                                                   #
8d9d3a8d2Smrg# Generated with "ci-fairy generate-template", edit #
9d9d3a8d2Smrg# .gitlab-ci/ci.template and .gitlab-ci/config.yml  #
10d9d3a8d2Smrg# and rerun "ci-fairy generate-template" to change  #
11d9d3a8d2Smrg# this file.                                        #
12d9d3a8d2Smrg#                                                   #
13d9d3a8d2Smrg#####################################################
14d9d3a8d2Smrg
15d9d3a8d2Smrg.templates_sha: &template_sha 3d03cccd770c04e63b40325b42223495274d6a1d
16d9d3a8d2Smrg
17d9d3a8d2Smrginclude:
18d9d3a8d2Smrg  - project: 'freedesktop/ci-templates'
19d9d3a8d2Smrg    ref: *template_sha
20d9d3a8d2Smrg    file:
21d9d3a8d2Smrg      - '/templates/ci-fairy.yml'
22d9d3a8d2Smrg    {% for d in distributions %}
23d9d3a8d2Smrg      - '/templates/{{d.name}}.yml'
24d9d3a8d2Smrg    {% endfor %}
258db88b12Smrg  - template: Security/SAST.gitlab-ci.yml
26d9d3a8d2Smrg
27d9d3a8d2Smrgstages:
28d9d3a8d2Smrg  - sanity check
29d9d3a8d2Smrg  - prep
30d9d3a8d2Smrg  - build
318db88b12Smrg  - test
32d9d3a8d2Smrg
33d9d3a8d2Smrgvariables:
34d9d3a8d2Smrg  FDO_UPSTREAM_REPO: xorg/lib/libxcvt
35d9d3a8d2Smrg  MESON_BUILDDIR: "builddir"
36d9d3a8d2Smrg  NINJA_ARGS: ''
37d9d3a8d2Smrg  MESON_ARGS: ''
38d9d3a8d2Smrg  MESON_TEST_ARGS: ''
39d9d3a8d2Smrg  GIT_DEPTH: 1
40d9d3a8d2Smrg
41d9d3a8d2Smrg.policy:
42d9d3a8d2Smrg  retry:
43d9d3a8d2Smrg    max: 2
44d9d3a8d2Smrg    when:
45d9d3a8d2Smrg      - runner_system_failure
46d9d3a8d2Smrg      - stuck_or_timeout_failure
47d9d3a8d2Smrg  # cancel run when a newer version is pushed to the branch
48d9d3a8d2Smrg  interruptible: true
49d9d3a8d2Smrg
50d9d3a8d2Smrg
51d9d3a8d2Smrg# Re-generate the CI script and make sure it's the one currently checked in
52d9d3a8d2Smrg# If this job fails, re-generate the gitlab-ci.yml script, see
53d9d3a8d2Smrg# $SRCDIR/.gitlab-ci/generate-gitlab-ci.py
54d9d3a8d2Smrg#
55d9d3a8d2Smrgcheck-ci-script:
56d9d3a8d2Smrg  extends:
57d9d3a8d2Smrg    - .fdo.ci-fairy
58d9d3a8d2Smrg  stage: sanity check
59d9d3a8d2Smrg  script:
60d9d3a8d2Smrg    - ci-fairy generate-template --verify && exit 0 || true
61d9d3a8d2Smrg    - echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
62d9d3a8d2Smrg    - exit 1
63d9d3a8d2Smrg
64d9d3a8d2Smrg#
65d9d3a8d2Smrg# Verify that commit messages are as expected, signed-off, etc.
66d9d3a8d2Smrg#
67d9d3a8d2Smrgcheck-commit:
68d9d3a8d2Smrg  extends:
69d9d3a8d2Smrg    - .fdo.ci-fairy
70d9d3a8d2Smrg  stage: sanity check
71d9d3a8d2Smrg  script:
72d9d3a8d2Smrg    - ci-fairy check-commits --signed-off-by --junit-xml=results.xml
73d9d3a8d2Smrg  except:
74d9d3a8d2Smrg    - master@xorg/lib/libxcvt
75d9d3a8d2Smrg  variables:
76d9d3a8d2Smrg    GIT_DEPTH: 100
77d9d3a8d2Smrg  artifacts:
78d9d3a8d2Smrg    reports:
79d9d3a8d2Smrg      junit: results.xml
80d9d3a8d2Smrg
81d9d3a8d2Smrg#
82d9d3a8d2Smrg# Verify that merge request has the "allow collaboration" checkbox ticked
83d9d3a8d2Smrg#
84d9d3a8d2Smrgcheck-merge-request:
85d9d3a8d2Smrg  extends:
86d9d3a8d2Smrg    - .fdo.ci-fairy
87d9d3a8d2Smrg  stage: sanity check
88d9d3a8d2Smrg  script:
89d9d3a8d2Smrg    - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=results.xml
90d9d3a8d2Smrg  artifacts:
91d9d3a8d2Smrg    when: on_failure
92d9d3a8d2Smrg    reports:
93d9d3a8d2Smrg      junit: results.xml
94d9d3a8d2Smrg  allow_failure: true
95d9d3a8d2Smrg
96d9d3a8d2Smrg{% for d in distributions %}
97d9d3a8d2Smrg
98d9d3a8d2Smrg.{{d.name}}.{{d.version}}:
99d9d3a8d2Smrg  variables:
100d9d3a8d2Smrg    FDO_DISTRIBUTION_VERSION: '{{d.version}}'
101d9d3a8d2Smrg    FDO_DISTRIBUTION_TAG: '{{d.tag}}'
102d9d3a8d2Smrg
103d9d3a8d2Smrgprep-{{d.name}}-{{d.version}}:
104d9d3a8d2Smrg  extends:
105d9d3a8d2Smrg    - .fdo.container-build@{{d.name}}
106d9d3a8d2Smrg    - .{{d.name}}.{{d.version}}
107d9d3a8d2Smrg  stage: prep
108d9d3a8d2Smrg  variables:
109d9d3a8d2Smrg    FDO_DISTRIBUTION_PACKAGES: "{{' '.join(d.packages)}}"
110d9d3a8d2Smrg
111d9d3a8d2Smrgbuild-{{d.name}}-{{d.version}}:
112d9d3a8d2Smrg  extends:
113d9d3a8d2Smrg    - .fdo.distribution-image@{{d.name}}
114d9d3a8d2Smrg    - .{{d.name}}.{{d.version}}
115d9d3a8d2Smrg  stage: build
116d9d3a8d2Smrg  script:
117d9d3a8d2Smrg    - .gitlab-ci/meson-build.sh
118d9d3a8d2Smrg{% endfor %}
119