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