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