nir: unify lower_bitfield_extract with has_bfe
[platform/upstream/mesa.git] / .gitlab-ci.yml
1 workflow:
2   rules:
3     # do not duplicate pipelines on merge pipelines
4     - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" && $GITLAB_USER_LOGIN == "marge-bot"
5       when: never
6     # merge pipeline
7     - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
8       variables:
9         MESA_CI_PERFORMANCE_ENABLED: 1
10         VALVE_INFRA_VANGOGH_JOB_PRIORITY: ""  # Empty tags are ignored by gitlab
11     # post-merge pipeline
12     - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
13       variables:
14         JOB_PRIORITY: 40
15         VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
16     # any other pipeline
17     - if: $GITLAB_USER_LOGIN != "marge-bot"
18       variables:
19         JOB_PRIORITY: 50
20         VALVE_INFRA_VANGOGH_JOB_PRIORITY: priority:low
21     - when: always
22
23 variables:
24   FDO_UPSTREAM_REPO: mesa/mesa
25   MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
26   CI_PRE_CLONE_SCRIPT: |-
27           set -o xtrace
28           wget -q -O download-git-cache.sh ${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/download-git-cache.sh
29           bash download-git-cache.sh
30           rm download-git-cache.sh
31           set +o xtrace
32   CI_JOB_JWT_FILE: /minio_jwt
33   S3_HOST: s3.freedesktop.org
34   # per-pipeline artifact storage on MinIO
35   PIPELINE_ARTIFACTS_BASE: ${S3_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
36   # per-job artifact storage on MinIO
37   JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID}
38   KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/gfx-ci/linux/${KERNEL_TAG}
39   # reference images stored for traces
40   PIGLIT_REPLAY_REFERENCE_IMAGES_BASE: "${S3_HOST}/mesa-tracie-results/$FDO_UPSTREAM_REPO"
41   # For individual CI farm status see .ci-farms folder
42   # Disable farm with   `git mv .ci-farms{,-disabled}/$farm_name`
43   # Re-enable farm with `git mv .ci-farms{-disabled,}/$farm_name`
44   # NEVER MIX FARM MAINTENANCE WITH ANY OTHER CHANGE IN THE SAME MERGE REQUEST!
45
46 default:
47   before_script:
48     - >
49       export SCRIPTS_DIR=$(mktemp -d) &&
50       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" &&
51       . ${SCRIPTS_DIR}/setup-test-env.sh &&
52       echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}" &&
53       unset CI_JOB_JWT  # Unsetting vulnerable env variables
54
55   after_script:
56     # Work around https://gitlab.com/gitlab-org/gitlab/-/issues/20338
57     - find -name '*.log' -exec mv {} {}.txt \;
58
59     - >
60       set +x
61
62       test -e "${CI_JOB_JWT_FILE}" &&
63       export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
64       rm "${CI_JOB_JWT_FILE}"
65
66   # Retry when job fails. Failed jobs can be found in the Mesa CI Daily Reports:
67   # https://gitlab.freedesktop.org/mesa/mesa/-/issues/?sort=created_date&state=opened&label_name%5B%5D=CI%20daily
68   retry:
69     max: 1
70     # Ignore runner_unsupported, stale_schedule, archived_failure, or
71     # unmet_prerequisites
72     when:
73       - api_failure
74       - runner_system_failure
75       - script_failure
76       - job_execution_timeout
77       - scheduler_failure
78       - data_integrity_failure
79       - unknown_failure
80
81 include:
82   - project: 'freedesktop/ci-templates'
83     ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
84     file:
85       - '/templates/ci-fairy.yml'
86   - project: 'freedesktop/ci-templates'
87     ref: *ci-templates-commit
88     file:
89       - '/templates/alpine.yml'
90       - '/templates/debian.yml'
91       - '/templates/fedora.yml'
92   - local: '.gitlab-ci/image-tags.yml'
93   - local: '.gitlab-ci/lava/lava-gitlab-ci.yml'
94   - local: '.gitlab-ci/container/gitlab-ci.yml'
95   - local: '.gitlab-ci/build/gitlab-ci.yml'
96   - local: '.gitlab-ci/test/gitlab-ci.yml'
97   - local: '.gitlab-ci/farm-rules.yml'
98   - local: '.gitlab-ci/test-source-dep.yml'
99   - local: 'docs/gitlab-ci.yml'
100   - local: 'src/amd/ci/gitlab-ci.yml'
101   - local: 'src/broadcom/ci/gitlab-ci.yml'
102   - local: 'src/etnaviv/ci/gitlab-ci.yml'
103   - local: 'src/freedreno/ci/gitlab-ci.yml'
104   - local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
105   - local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
106   - local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
107   - local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
108   - local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
109   - local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
110   - local: 'src/gallium/drivers/softpipe/ci/gitlab-ci.yml'
111   - local: 'src/gallium/drivers/virgl/ci/gitlab-ci.yml'
112   - local: 'src/gallium/drivers/zink/ci/gitlab-ci.yml'
113   - local: 'src/gallium/frontends/lavapipe/ci/gitlab-ci.yml'
114   - local: 'src/intel/ci/gitlab-ci.yml'
115   - local: 'src/microsoft/ci/gitlab-ci.yml'
116   - local: 'src/panfrost/ci/gitlab-ci.yml'
117   - local: 'src/virtio/ci/gitlab-ci.yml'
118
119 stages:
120   - sanity
121   - container
122   - git-archive
123   - build-x86_64
124   - build-misc
125   - lint
126   - amd
127   - intel
128   - nouveau
129   - arm
130   - broadcom
131   - freedreno
132   - etnaviv
133   - software-renderer
134   - layered-backends
135   - deploy
136
137
138 # YAML anchors for rule conditions
139 # --------------------------------
140 .rules-anchors:
141   rules:
142     # Post-merge pipeline
143     - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
144       when: on_success
145     # Post-merge pipeline, not for Marge Bot
146     - if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
147       when: on_success
148     # Pre-merge pipeline
149     - if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
150       when: on_success
151     # Pre-merge pipeline for Marge Bot
152     - if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
153       when: on_success
154
155
156 # When to automatically run the CI for build jobs
157 .build-rules:
158   rules:
159     # If any files affecting the pipeline are changed, build/test jobs run
160     # automatically once all dependency jobs have passed
161     - changes: &all_paths
162       - VERSION
163       - bin/git_sha1_gen.py
164       - bin/install_megadrivers.py
165       - bin/symbols-check.py
166       # GitLab CI
167       - .gitlab-ci.yml
168       - .gitlab-ci/**/*
169       # Meson
170       - meson*
171       - build-support/**/*
172       - subprojects/**/*
173       # Source code
174       - include/**/*
175       - src/**/*
176       - .ci-farms/*
177       when: on_success
178     # Otherwise, build/test jobs won't run because no rule matched.
179
180
181 .ci-deqp-artifacts:
182   artifacts:
183     name: "mesa_${CI_JOB_NAME}"
184     when: always
185     untracked: false
186     paths:
187       # Watch out!  Artifacts are relative to the build dir.
188       # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
189       - artifacts
190       - _build/meson-logs/*.txt
191       - _build/meson-logs/strace
192
193 .container-rules:
194   rules:
195     # Run pipeline by default in the main project if any CI pipeline
196     # configuration files were changed, to ensure docker images are up to date
197     - if: *is-post-merge
198       changes:
199       - .gitlab-ci.yml
200       - .gitlab-ci/**/*
201       when: on_success
202     # Run pipeline by default if it was triggered by Marge Bot, is for a
203     # merge request, and any files affecting the pipeline were changed
204     - if: *is-pre-merge-for-marge
205       changes:
206         *all_paths
207       when: on_success
208     # Run pipeline by default in the main project if it was not triggered by
209     # Marge Bot, and any files affecting the pipeline were changed
210     - if: *is-post-merge-not-for-marge
211       changes:
212         *all_paths
213       when: on_success
214     # Allow triggering jobs manually in other cases if any files affecting the
215     # pipeline were changed
216     - changes:
217         *all_paths
218       when: manual
219     # Otherwise, container jobs won't run because no rule matched.
220
221 # Git archive
222
223 make git archive:
224   extends:
225     - .fdo.ci-fairy
226   stage: git-archive
227   rules:
228     - !reference [.scheduled_pipeline-rules, rules]
229   # ensure we are running on packet
230   tags:
231     - packet.net
232   script:
233     # Compactify the .git directory
234     - git gc --aggressive
235     # Download & cache the perfetto subproject as well.
236     - rm -rf subprojects/perfetto ; mkdir -p subprojects/perfetto && curl https://android.googlesource.com/platform/external/perfetto/+archive/$(grep 'revision =' subprojects/perfetto.wrap | cut -d ' ' -f3).tar.gz | tar zxf - -C subprojects/perfetto
237     # compress the current folder
238     - tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
239
240     - ci-fairy s3cp --token-file "${CI_JOB_JWT_FILE}" ../$CI_PROJECT_NAME.tar.gz https://$S3_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
241
242
243 # Sanity checks of MR settings and commit logs
244 sanity:
245   extends:
246     - .fdo.ci-fairy
247   stage: sanity
248   rules:
249     - if: *is-pre-merge
250       when: on_success
251     # Other cases default to never
252   variables:
253     GIT_STRATEGY: none
254   script:
255     # ci-fairy check-commits --junit-xml=check-commits.xml
256     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
257   artifacts:
258     when: on_failure
259     reports:
260       junit: check-*.xml
261
262
263 # Jobs that need to pass before spending hardware resources on further testing
264 .required-for-hardware-jobs:
265   needs:
266     - job: clang-format
267       optional: true
268     - job: rustfmt
269       optional: true