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