loader: Add Xe KMD support
[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     - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH
7       variables:
8         LAVA_JOB_PRIORITY: 40
9     - if: $GITLAB_USER_LOGIN != "marge-bot"
10       variables:
11         LAVA_JOB_PRIORITY: 50
12     - when: always
13
14 variables:
15   FDO_UPSTREAM_REPO: mesa/mesa
16   MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
17   CI_PRE_CLONE_SCRIPT: |-
18           set -o xtrace
19           wget -q -O download-git-cache.sh ${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/download-git-cache.sh
20           bash download-git-cache.sh
21           rm download-git-cache.sh
22           set +o xtrace
23   CI_JOB_JWT_FILE: /minio_jwt
24   MINIO_HOST: s3.freedesktop.org
25   # per-pipeline artifact storage on MinIO
26   PIPELINE_ARTIFACTS_BASE: ${MINIO_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
27   # per-job artifact storage on MinIO
28   JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID}
29   # reference images stored for traces
30   PIGLIT_REPLAY_REFERENCE_IMAGES_BASE: "${MINIO_HOST}/mesa-tracie-results/$FDO_UPSTREAM_REPO"
31   # Individual CI farm status, set to "offline" to disable jobs
32   # running on a particular CI farm (ie. for outages, etc):
33   FD_FARM: "online"
34   COLLABORA_FARM: "online"
35   MICROSOFT_FARM: "online"
36   LIMA_FARM: "offline"
37   IGALIA_FARM: "online"
38   ANHOLT_FARM: "online"
39   VALVE_FARM: "online"
40   AUSTRIANCODER_FARM: "online"  # only etnaviv GPUs
41
42 default:
43   before_script:
44     - >
45       export SCRIPTS_DIR=$(mktemp -d) &&
46       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" &&
47       chmod +x ${SCRIPTS_DIR}/setup-test-env.sh &&
48       . ${SCRIPTS_DIR}/setup-test-env.sh &&
49       echo -n "${CI_JOB_JWT}" > "${CI_JOB_JWT_FILE}" &&
50       unset CI_JOB_JWT  # Unsetting vulnerable env variables
51
52   after_script:
53     - >
54       set +x
55
56       test -e "${CI_JOB_JWT_FILE}" &&
57       export CI_JOB_JWT="$(<${CI_JOB_JWT_FILE})" &&
58       rm "${CI_JOB_JWT_FILE}"
59
60   # Retry when job fails. Failed jobs can be found in the Mesa CI Daily Reports:
61   # https://gitlab.freedesktop.org/mesa/mesa/-/issues/?sort=created_date&state=opened&label_name%5B%5D=CI%20daily
62   retry:
63     max: 1
64
65 include:
66   - project: 'freedesktop/ci-templates'
67     ref: 16bc29078de5e0a067ff84a1a199a3760d3b3811
68     file:
69       - '/templates/ci-fairy.yml'
70   - project: 'freedesktop/ci-templates'
71     ref: *ci-templates-commit
72     file:
73       - '/templates/alpine.yml'
74       - '/templates/debian.yml'
75       - '/templates/fedora.yml'
76   - local: '.gitlab-ci/image-tags.yml'
77   - local: '.gitlab-ci/lava/lava-gitlab-ci.yml'
78   - local: '.gitlab-ci/container/gitlab-ci.yml'
79   - local: '.gitlab-ci/build/gitlab-ci.yml'
80   - local: '.gitlab-ci/test/gitlab-ci.yml'
81   - local: '.gitlab-ci/test-source-dep.yml'
82   - local: 'docs/gitlab-ci.yml'
83   - local: 'src/amd/ci/gitlab-ci.yml'
84   - local: 'src/broadcom/ci/gitlab-ci.yml'
85   - local: 'src/etnaviv/ci/gitlab-ci.yml'
86   - local: 'src/freedreno/ci/gitlab-ci.yml'
87   - local: 'src/gallium/drivers/crocus/ci/gitlab-ci.yml'
88   - local: 'src/gallium/drivers/d3d12/ci/gitlab-ci.yml'
89   - local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
90   - local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
91   - local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
92   - local: 'src/gallium/drivers/nouveau/ci/gitlab-ci.yml'
93   - local: 'src/gallium/drivers/softpipe/ci/gitlab-ci.yml'
94   - local: 'src/gallium/drivers/virgl/ci/gitlab-ci.yml'
95   - local: 'src/gallium/drivers/zink/ci/gitlab-ci.yml'
96   - local: 'src/gallium/frontends/lavapipe/ci/gitlab-ci.yml'
97   - local: 'src/intel/ci/gitlab-ci.yml'
98   - local: 'src/microsoft/ci/gitlab-ci.yml'
99   - local: 'src/panfrost/ci/gitlab-ci.yml'
100   - local: 'src/virtio/ci/gitlab-ci.yml'
101
102 stages:
103   - sanity
104   - container
105   - git-archive
106   - build-x86_64
107   - build-misc
108   - lint
109   - amd
110   - intel
111   - nouveau
112   - arm
113   - broadcom
114   - freedreno
115   - etnaviv
116   - software-renderer
117   - layered-backends
118   - deploy
119
120
121 # YAML anchors for rule conditions
122 # --------------------------------
123 .rules-anchors:
124   rules:
125     # Post-merge pipeline
126     - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_BRANCH'
127       when: on_success
128     # Post-merge pipeline, not for Marge Bot
129     - if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_COMMIT_BRANCH'
130       when: on_success
131     # Pre-merge pipeline
132     - if: &is-pre-merge '$CI_PIPELINE_SOURCE == "merge_request_event"'
133       when: on_success
134     # Pre-merge pipeline for Marge Bot
135     - if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_PIPELINE_SOURCE == "merge_request_event"'
136       when: on_success
137
138
139 # When to automatically run the CI for build jobs
140 .build-rules:
141   rules:
142     # If any files affecting the pipeline are changed, build/test jobs run
143     # automatically once all dependency jobs have passed
144     - changes: &all_paths
145       - VERSION
146       - bin/git_sha1_gen.py
147       - bin/install_megadrivers.py
148       - bin/symbols-check.py
149       # GitLab CI
150       - .gitlab-ci.yml
151       - .gitlab-ci/**/*
152       # Meson
153       - meson*
154       - build-support/**/*
155       - subprojects/**/*
156       # Source code
157       - include/**/*
158       - src/**/*
159       when: on_success
160     # Otherwise, build/test jobs won't run because no rule matched.
161
162
163 .ci-deqp-artifacts:
164   artifacts:
165     name: "mesa_${CI_JOB_NAME}"
166     when: always
167     untracked: false
168     paths:
169       # Watch out!  Artifacts are relative to the build dir.
170       # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
171       - artifacts
172       - _build/meson-logs/*.txt
173       - _build/meson-logs/strace
174
175 .container-rules:
176   rules:
177     # Run pipeline by default in the main project if any CI pipeline
178     # configuration files were changed, to ensure docker images are up to date
179     - if: *is-post-merge
180       changes:
181       - .gitlab-ci.yml
182       - .gitlab-ci/**/*
183       when: on_success
184     # Run pipeline by default if it was triggered by Marge Bot, is for a
185     # merge request, and any files affecting the pipeline were changed
186     - if: *is-pre-merge-for-marge
187       changes:
188         *all_paths
189       when: on_success
190     # Run pipeline by default in the main project if it was not triggered by
191     # Marge Bot, and any files affecting the pipeline were changed
192     - if: *is-post-merge-not-for-marge
193       changes:
194         *all_paths
195       when: on_success
196     # Allow triggering jobs manually in other cases if any files affecting the
197     # pipeline were changed
198     - changes:
199         *all_paths
200       when: manual
201     # Otherwise, container jobs won't run because no rule matched.
202
203 # Git archive
204
205 make git archive:
206   extends:
207     - .fdo.ci-fairy
208   stage: git-archive
209   rules:
210     - !reference [.scheduled_pipeline-rules, rules]
211   # ensure we are running on packet
212   tags:
213     - packet.net
214   script:
215     # Compactify the .git directory
216     - git gc --aggressive
217     # compress the current folder
218     - tar -cvzf ../$CI_PROJECT_NAME.tar.gz .
219
220     - 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
221
222
223 # Sanity checks of MR settings and commit logs
224 sanity:
225   extends:
226     - .fdo.ci-fairy
227   stage: sanity
228   rules:
229     - if: *is-pre-merge
230       when: on_success
231     # Other cases default to never
232   variables:
233     GIT_STRATEGY: none
234   script:
235     # ci-fairy check-commits --junit-xml=check-commits.xml
236     - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
237   artifacts:
238     when: on_failure
239     reports:
240       junit: check-*.xml