aco: use can_use_input_modifiers helper
[platform/upstream/mesa.git] / .gitlab-ci.yml
1 workflow:
2   rules:
3     - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
4       variables:
5         MESA_CI_PERFORMANCE_ENABLED: 1
6     - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
7       variables:
8         LAVA_JOB_PRIORITY: 40
9     - if: $GITLAB_USER_LOGIN != "marge-bot"
10       variables:
11         LAVA_JOB_PRIORITY: 50
12     - when: always
13
14 variables:
15   FDO_UPSTREAM_REPO: mesa/mesa
16   MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
17   CI_PRE_CLONE_SCRIPT: |-
18           set -o xtrace
19           wget -q -O download-git-cache.sh ${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/download-git-cache.sh
20           bash download-git-cache.sh
21           rm download-git-cache.sh
22           set +o xtrace
23   CI_JOB_JWT_FILE: /minio_jwt
24   MINIO_HOST: s3.freedesktop.org
25   # per-pipeline artifact storage on MinIO
26   PIPELINE_ARTIFACTS_BASE: ${MINIO_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
27   # per-job artifact storage on MinIO
28   JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID}
29   # reference images stored for traces
30   PIGLIT_REPLAY_REFERENCE_IMAGES_BASE: "${MINIO_HOST}/mesa-tracie-results/$FDO_UPSTREAM_REPO"
31   # Individual CI farm status, set to "offline" to disable jobs
32   # running on a particular CI farm (ie. for outages, etc):
33   FD_FARM: "online"
34   COLLABORA_FARM: "online"
35   MICROSOFT_FARM: "online"
36   LIMA_FARM: "online"
37   IGALIA_FARM: "online"
38   ANHOLT_FARM: "online"
39   VALVE_FARM: "online"
40   AUSTRIANCODER_FARM: "online"  # only etnaviv GPUs
41
42 default:
43   before_script:
44     - >
45       export SCRIPTS_DIR=$(mktemp -d) &&
46       curl -L -s --retry 4 -f --retry-all-errors --retry-delay 60 -O --output-dir "${SCRIPTS_DIR}" "${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/setup-test-env.sh" &&
47       . ${SCRIPTS_DIR}/setup-test-env.sh &&
48       echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}" &&
49       unset CI_JOB_JWT  # Unsetting vulnerable env variables
50
51   after_script:
52     - >
53       set +x
54
55       test -e "${CI_JOB_JWT_FILE}" &&
56       export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
57       rm "${CI_JOB_JWT_FILE}"
58
59   # Retry when job fails. Failed jobs can be found in the Mesa CI Daily Reports:
60   # https://gitlab.freedesktop.org/mesa/mesa/-/issues/?sort=created_date&state=opened&label_name%5B%5D=CI%20daily
61   retry:
62     max: 1
63
64 include:
65   - project: 'freedesktop/ci-templates'
66     ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
67     file:
68       - '/templates/ci-fairy.yml'
69   - project: 'freedesktop/ci-templates'
70     ref: *ci-templates-commit
71     file:
72       - '/templates/alpine.yml'
73       - '/templates/debian.yml'
74       - '/templates/fedora.yml'
75   - local: '.gitlab-ci/image-tags.yml'
76   - local: '.gitlab-ci/lava/lava-gitlab-ci.yml'
77   - local: '.gitlab-ci/container/gitlab-ci.yml'
78   - local: '.gitlab-ci/build/gitlab-ci.yml'
79   - local: '.gitlab-ci/test/gitlab-ci.yml'
80   - local: '.gitlab-ci/test-source-dep.yml'
81   - local: 'docs/gitlab-ci.yml'
82   - local: 'src/amd/ci/gitlab-ci.yml'
83   - local: 'src/broadcom/ci/gitlab-ci.yml'
84   - local: 'src/etnaviv/ci/gitlab-ci.yml'
85   - local: 'src/freedreno/ci/gitlab-ci.yml'
86   - local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
87   - local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
88   - local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
89   - local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
90   - local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
91   - local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
92   - local: 'src/gallium/drivers/softpipe/ci/gitlab-ci.yml'
93   - local: 'src/gallium/drivers/virgl/ci/gitlab-ci.yml'
94   - local: 'src/gallium/drivers/zink/ci/gitlab-ci.yml'
95   - local: 'src/gallium/frontends/lavapipe/ci/gitlab-ci.yml'
96   - local: 'src/intel/ci/gitlab-ci.yml'
97   - local: 'src/microsoft/ci/gitlab-ci.yml'
98   - local: 'src/panfrost/ci/gitlab-ci.yml'
99   - local: 'src/virtio/ci/gitlab-ci.yml'
100
101 stages:
102   - sanity
103   - container
104   - git-archive
105   - build-x86_64
106   - build-misc
107   - lint
108   - amd
109   - intel
110   - nouveau
111   - arm
112   - broadcom
113   - freedreno
114   - etnaviv
115   - software-renderer
116   - layered-backends
117   - deploy
118
119
120 # YAML anchors for rule conditions
121 # --------------------------------
122 .rules-anchors:
123   rules:
124     # Post-merge pipeline
125     - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
126       when: on_success
127     # Post-merge pipeline, not for Marge Bot
128     - if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
129       when: on_success
130     # Pre-merge pipeline
131     - if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
132       when: on_success
133     # Pre-merge pipeline for Marge Bot
134     - if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
135       when: on_success
136
137
138 # When to automatically run the CI for build jobs
139 .build-rules:
140   rules:
141     # If any files affecting the pipeline are changed, build/test jobs run
142     # automatically once all dependency jobs have passed
143     - changes: &all_paths
144       - VERSION
145       - bin/git_sha1_gen.py
146       - bin/install_megadrivers.py
147       - bin/symbols-check.py
148       # GitLab CI
149       - .gitlab-ci.yml
150       - .gitlab-ci/**/*
151       # Meson
152       - meson*
153       - build-support/**/*
154       - subprojects/**/*
155       # Source code
156       - include/**/*
157       - src/**/*
158       when: on_success
159     # Otherwise, build/test jobs won't run because no rule matched.
160
161
162 .ci-deqp-artifacts:
163   artifacts:
164     name: "mesa_${CI_JOB_NAME}"
165     when: always
166     untracked: false
167     paths:
168       # Watch out!  Artifacts are relative to the build dir.
169       # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
170       - artifacts
171       - _build/meson-logs/*.txt
172       - _build/meson-logs/strace
173
174 .container-rules:
175   rules:
176     # Run pipeline by default in the main project if any CI pipeline
177     # configuration files were changed, to ensure docker images are up to date
178     - if: *is-post-merge
179       changes:
180       - .gitlab-ci.yml
181       - .gitlab-ci/**/*
182       when: on_success
183     # Run pipeline by default if it was triggered by Marge Bot, is for a
184     # merge request, and any files affecting the pipeline were changed
185     - if: *is-pre-merge-for-marge
186       changes:
187         *all_paths
188       when: on_success
189     # Run pipeline by default in the main project if it was not triggered by
190     # Marge Bot, and any files affecting the pipeline were changed
191     - if: *is-post-merge-not-for-marge
192       changes:
193         *all_paths
194       when: on_success
195     # Allow triggering jobs manually in other cases if any files affecting the
196     # pipeline were changed
197     - changes:
198         *all_paths
199       when: manual
200     # Otherwise, container jobs won't run because no rule matched.
201
202 # Git archive
203
204 make git archive:
205   extends:
206     - .fdo.ci-fairy
207   stage: git-archive
208   rules:
209     - !reference [.scheduled_pipeline-rules, rules]
210   # ensure we are running on packet
211   tags:
212     - packet.net
213   script:
214     # Compactify the .git directory
215     - git gc --aggressive
216     # compress the current folder
217     - tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
218
219     - ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$MINIO_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
220
221
222 # Sanity checks of MR settings and commit logs
223 sanity:
224   extends:
225     - .fdo.ci-fairy
226   stage: sanity
227   rules:
228     - if: *is-pre-merge
229       when: on_success
230     # Other cases default to never
231   variables:
232     GIT_STRATEGY: none
233   script:
234     # ci-fairy check-commits --junit-xml=check-commits.xml
235     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
236   artifacts:
237     when: on_failure
238     reports:
239       junit: check-*.xml