intel/dev: Move i915 code to i915/intel_device_info.c
[platform/upstream/mesa.git] / .gitlab-ci.yml
1 variables:
2   FDO_UPSTREAM_REPO: mesa/mesa
3   MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
4   CI_PRE_CLONE_SCRIPT: |-
5           set -o xtrace
6           wget -q -O download-git-cache.sh ${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/download-git-cache.sh
7           bash download-git-cache.sh
8           rm download-git-cache.sh
9           set +o xtrace
10   CI_JOB_JWT_FILE: /minio_jwt
11   MINIO_HOST: s3.freedesktop.org
12   # per-pipeline artifact storage on MinIO
13   PIPELINE_ARTIFACTS_BASE: ${MINIO_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
14   # per-job artifact storage on MinIO
15   JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID}
16   # reference images stored for traces
17   PIGLIT_REPLAY_REFERENCE_IMAGES_BASE: "${MINIO_HOST}/mesa-tracie-results/$FDO_UPSTREAM_REPO"
18   # Individual CI farm status, set to "offline" to disable jobs
19   # running on a particular CI farm (ie. for outages, etc):
20   FD_FARM: "online"
21   COLLABORA_FARM: "online"
22   MICROSOFT_FARM: "online"
23   LIMA_FARM: "online"
24   IGALIA_FARM: "online"
25   ANHOLT_FARM: "online"
26   VALVE_FARM: "online"
27   AUSTRIANCODER_FARM: "online"  # only etnaviv GPUs
28
29 default:
30   before_script:
31     - echo -e "\e[0Ksection_start:$(date +%s):unset_env_vars_section[collapsed=true]\r\e[0KUnsetting vulnerable environment variables"
32     - echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}"
33     - unset CI_JOB_JWT
34     - echo -e "\e[0Ksection_end:$(date +%s):unset_env_vars_section\r\e[0K"
35
36   after_script:
37     - >
38       set +x
39
40       test -e "${CI_JOB_JWT_FILE}" &&
41       export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
42       rm "${CI_JOB_JWT_FILE}"
43
44   # Retry build or test jobs up to twice when the gitlab-runner itself fails somehow.
45   retry:
46     max: 2
47     when:
48       - runner_system_failure
49
50 include:
51   - project: 'freedesktop/ci-templates'
52     ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
53     file:
54       - '/templates/ci-fairy.yml'
55   - project: 'freedesktop/ci-templates'
56     ref: *ci-templates-commit
57     file:
58       - '/templates/alpine.yml'
59       - '/templates/debian.yml'
60       - '/templates/fedora.yml'
61   - local: '.gitlab-ci/image-tags.yml'
62   - local: '.gitlab-ci/lava/lava-gitlab-ci.yml'
63   - local: '.gitlab-ci/container/gitlab-ci.yml'
64   - local: '.gitlab-ci/build/gitlab-ci.yml'
65   - local: '.gitlab-ci/test/gitlab-ci.yml'
66   - local: '.gitlab-ci/test-source-dep.yml'
67   - local: 'src/amd/ci/gitlab-ci.yml'
68   - local: 'src/broadcom/ci/gitlab-ci.yml'
69   - local: 'src/etnaviv/ci/gitlab-ci.yml'
70   - local: 'src/freedreno/ci/gitlab-ci.yml'
71   - local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
72   - local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
73   - local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
74   - local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
75   - local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
76   - local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
77   - local: 'src/gallium/drivers/softpipe/ci/gitlab-ci.yml'
78   - local: 'src/gallium/drivers/virgl/ci/gitlab-ci.yml'
79   - local: 'src/gallium/drivers/zink/ci/gitlab-ci.yml'
80   - local: 'src/gallium/frontends/lavapipe/ci/gitlab-ci.yml'
81   - local: 'src/intel/ci/gitlab-ci.yml'
82   - local: 'src/microsoft/ci/gitlab-ci.yml'
83   - local: 'src/panfrost/ci/gitlab-ci.yml'
84   - local: 'src/virtio/ci/gitlab-ci.yml'
85
86 stages:
87   - sanity
88   - container
89   - git-archive
90   - build-x86_64
91   - build-misc
92   - lint
93   - amd
94   - intel
95   - nouveau
96   - arm
97   - broadcom
98   - freedreno
99   - etnaviv
100   - software-renderer
101   - layered-backends
102   - deploy
103
104
105 # YAML anchors for rule conditions
106 # --------------------------------
107 .rules-anchors:
108   rules:
109     # Pipeline for forked project branch
110     - if: &is-forked-branch '$CI_COMMIT_BRANCH && $CI_PROJECT_NAMESPACE != "mesa"'
111       when: manual
112     # Forked project branch / pre-merge pipeline not for Marge bot
113     - if: &is-forked-branch-or-pre-merge-not-for-marge '$CI_PROJECT_NAMESPACE != "mesa" || ($GITLAB_USER_LOGIN != "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event")'
114       when: manual
115     # Pipeline runs for the main branch of the upstream Mesa project
116     - if: &is-mesa-main '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_COMMIT_BRANCH'
117       when: always
118     # Post-merge pipeline
119     - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
120       when: on_success
121     # Post-merge pipeline, not for Marge Bot
122     - if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
123       when: on_success
124     # Pre-merge pipeline
125     - if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
126       when: on_success
127     # Pre-merge pipeline for Marge Bot
128     - if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
129       when: on_success
130
131
132 .docs-base:
133   variables:
134     BUILDER: html
135   extends:
136     - .fdo.ci-fairy
137     - .build-rules
138   artifacts:
139     expose_as: 'Documentation preview'
140     paths:
141     - public/
142   script:
143   - apk --no-cache add graphviz doxygen
144   - pip3 install sphinx===5.1.1 breathe===4.34.0 mako===1.2.3 sphinx_rtd_theme===1.0.0
145   - docs/doxygen-wrapper.py --out-dir=docs/doxygen_xml
146   - sphinx-build -W -b $BUILDER docs public
147
148 pages:
149   extends: .docs-base
150   stage: deploy
151   needs: []
152   rules:
153     - !reference [.no_scheduled_pipelines-rules, rules]
154     - if: *is-mesa-main
155       changes: &docs-or-ci
156       - docs/**/*
157       - .gitlab-ci.yml
158       when: always
159     # Other cases default to never
160
161 test-docs:
162   extends: .docs-base
163   # Cancel job if a newer commit is pushed to the same branch
164   interruptible: true
165   stage: deploy
166   needs: []
167   rules:
168     - !reference [.no_scheduled_pipelines-rules, rules]
169     - if: *is-forked-branch
170       changes: *docs-or-ci
171       when: manual
172     # Other cases default to never
173
174 test-docs-mr:
175   extends:
176     - test-docs
177   needs:
178     - sanity
179   rules:
180     - if: *is-pre-merge
181       changes: *docs-or-ci
182       when: on_success
183     # Other cases default to never
184
185 lincheck-docs:
186   extends: .docs-base
187   # Cancel job if a newer commit is pushed to the same branch
188   interruptible: true
189   stage: deploy
190   needs: []
191   rules:
192     - !reference [.scheduled_pipeline-rules, rules]
193   allow_failure: true
194   variables:
195     BUILDER: linkcheck
196
197 # When to automatically run the CI for build jobs
198 .build-rules:
199   rules:
200     - !reference [.no_scheduled_pipelines-rules, rules]
201     # If any files affecting the pipeline are changed, build/test jobs run
202     # automatically once all dependency jobs have passed
203     - changes: &all_paths
204       - VERSION
205       - bin/git_sha1_gen.py
206       - bin/install_megadrivers.py
207       - bin/meson_get_version.py
208       - bin/symbols-check.py
209       # GitLab CI
210       - .gitlab-ci.yml
211       - .gitlab-ci/**/*
212       # Meson
213       - meson*
214       - build-support/**/*
215       - subprojects/**/*
216       # Source code
217       - include/**/*
218       - src/**/*
219       when: on_success
220     # Otherwise, build/test jobs won't run because no rule matched.
221
222
223 .ci-deqp-artifacts:
224   artifacts:
225     name: "mesa_${CI_JOB_NAME}"
226     when: always
227     untracked: false
228     paths:
229       # Watch out!  Artifacts are relative to the build dir.
230       # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
231       - artifacts
232       - _build/meson-logs/*.txt
233       - _build/meson-logs/strace
234
235 .container-rules:
236   rules:
237     - !reference [.no_scheduled_pipelines-rules, rules]
238     # Run pipeline by default in the main project if any CI pipeline
239     # configuration files were changed, to ensure docker images are up to date
240     - if: *is-post-merge
241       changes:
242       - .gitlab-ci.yml
243       - .gitlab-ci/**/*
244       when: on_success
245     # Run pipeline by default if it was triggered by Marge Bot, is for a
246     # merge request, and any files affecting the pipeline were changed
247     - if: *is-pre-merge-for-marge
248       changes:
249         *all_paths
250       when: on_success
251     # Run pipeline by default in the main project if it was not triggered by
252     # Marge Bot, and any files affecting the pipeline were changed
253     - if: *is-post-merge-not-for-marge
254       changes:
255         *all_paths
256       when: on_success
257     # Allow triggering jobs manually in other cases if any files affecting the
258     # pipeline were changed
259     - changes:
260         *all_paths
261       when: manual
262     # Otherwise, container jobs won't run because no rule matched.
263
264 # Git archive
265
266 make git archive:
267   extends:
268     - .fdo.ci-fairy
269   stage: git-archive
270   rules:
271     - !reference [.scheduled_pipeline-rules, rules]
272   # ensure we are running on packet
273   tags:
274     - packet.net
275   script:
276     # Compactify the .git directory
277     - git gc --aggressive
278     # compress the current folder
279     - tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
280
281     - 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
282
283
284 # Sanity checks of MR settings and commit logs
285 sanity:
286   extends:
287     - .fdo.ci-fairy
288   stage: sanity
289   rules:
290     - if: *is-pre-merge
291       when: on_success
292     # Other cases default to never
293   variables:
294     GIT_STRATEGY: none
295   script:
296     # ci-fairy check-commits --junit-xml=check-commits.xml
297     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
298   artifacts:
299     when: on_failure
300     reports:
301       junit: check-*.xml
302
303 # Rules for tests that should not block merging, but should be available to
304 # optionally run with the "play" button in the UI in pre-merge non-marge
305 # pipelines.  This should appear in "extends:" after any includes of
306 # test-source-dep.yml rules, so that these rules replace those.
307 .test-manual-mr:
308   rules:
309     - !reference [.no_scheduled_pipelines-rules, rules]
310     - if: *is-forked-branch-or-pre-merge-not-for-marge
311       changes:
312         *all_paths
313       when: manual
314   variables:
315     JOB_TIMEOUT: 80
316