.gitlab-ci.yml 34.5 KB
Newer Older
1
variables:
2
  FDO_UPSTREAM_REPO: mesa/mesa
3
  MESA_TEMPLATES_COMMIT: &ci-templates-commit 290b79e0e78eab67a83766f4e9691be554fc4afd
4
5
6
7
  CI_PRE_CLONE_SCRIPT: |-
          set -o xtrace
          /usr/bin/wget -q -O- ${CI_PROJECT_URL}/-/raw/${CI_COMMIT_SHA}/.gitlab-ci/download-git-cache.sh | sh -
          set +o xtrace
8
  MINIO_HOST: minio-packet.freedesktop.org
9
10
  # per-pipeline artifact storage on MinIO
  PIPELINE_ARTIFACTS_BASE: ${MINIO_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID}
11
12
  # per-job artifact storage on MinIO
  JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID}
13
14

include:
15
  - project: 'freedesktop/ci-templates'
Michel Dänzer's avatar
Michel Dänzer committed
16
    ref: 79c325922670137e8f0a4dc5f6f097e0eb57c1af
17
    file:
18
      - '/templates/ci-fairy.yml'
19
  - project: 'freedesktop/ci-templates'
20
    ref: *ci-templates-commit
21
    file:
22
      - '/templates/debian.yml'
23
  - local: '.gitlab-ci/lava/lava-gitlab-ci.yml'
24
  - local: '.gitlab-ci/test-source-dep.yml'
25
26
27
  - local: 'src/amd/ci/gitlab-ci.yml'
  - local: 'src/broadcom/ci/gitlab-ci.yml'
  - local: 'src/freedreno/ci/gitlab-ci.yml'
28
  - local: 'src/gallium/drivers/i915/ci/gitlab-ci.yml'
29
30
  - local: 'src/gallium/drivers/iris/ci/gitlab-ci.yml'
  - local: 'src/gallium/drivers/lima/ci/gitlab-ci.yml'
31
  - local: 'src/gallium/drivers/llvmpipe/ci/gitlab-ci.yml'
32
33
  - local: 'src/gallium/drivers/panfrost/ci/gitlab-ci.yml'
  - local: 'src/gallium/drivers/radeonsi/ci/gitlab-ci.yml'
34
35
36
  - local: 'src/gallium/drivers/softpipe/ci/gitlab-ci.yml'
  - local: 'src/gallium/drivers/virgl/ci/gitlab-ci.yml'
  - local: 'src/gallium/drivers/zink/ci/gitlab-ci.yml'
37
  - local: 'src/gallium/frontends/lavapipe/ci/gitlab-ci.yml'
38

39
stages:
40
  - sanity
41
  - container
42
  - container-2
43
  - git-archive
44
  - meson-x86_64
45
  - build-misc
46
  - amd
47
  - intel
48
  - arm
49
  - broadcom
50
  - freedreno
51
  - software-renderer
52
  - layered-backends
53
  - deploy
54
  - success
55

56
57
58
59
# Generic rule to not run the job during scheduled pipelines
# ----------------------------------------------------------
.scheduled_pipelines-rules:
  rules: &ignore_scheduled_pipelines
60
    if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"'
61
62
    when: never

63
64
65
66
# YAML anchors for rule conditions
# --------------------------------
.rules-anchors:
  rules:
67
68
69
    # For Marge Bot
    - if: &is-for-marge '$GITLAB_USER_LOGIN == "marge-bot"'
      when: never
70
    # Forked project branch
71
    - if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
72
      when: manual
73
74
    # Forked project branch / pre-merge pipeline not for Marge bot
    - if: &is-forked-branch-or-pre-merge-not-for-marge '$CI_PROJECT_NAMESPACE != "mesa" || ($GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME)'
75
      when: manual
76
77
    # Pipeline runs for the main branch of the upstream Mesa project
    - if: &is-mesa-main '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_DEFAULT_BRANCH'
78
      when: always
79
80
81
    # Post-merge pipeline
    - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
      when: on_success
82
    # Post-merge pipeline, not for Marge Bot
83
    - if: &is-post-merge-not-for-marge '$CI_PROJECT_NAMESPACE == "mesa" && $GITLAB_USER_LOGIN != "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
84
      when: on_success
85
86
87
    # Pre-merge pipeline
    - if: &is-pre-merge '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
      when: on_success
88
89
90
    # Pre-merge pipeline for Marge Bot
    - if: &is-pre-merge-for-marge '$GITLAB_USER_LOGIN == "marge-bot" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
      when: on_success
91
92


93
.docs-base:
94
95
96
  extends:
    - .fdo.ci-fairy
    - .ci-run-policy
97
  script:
98
  - apk --no-cache add graphviz
99
  - pip3 install "sphinx<4.0" sphinx_rtd_theme
100
  - sphinx-build -W -b html docs public
101
102
103

pages:
  extends: .docs-base
104
  stage: deploy
105
106
107
  artifacts:
    paths:
    - public
108
  needs: []
109
  rules:
110
    - *ignore_scheduled_pipelines
111
    - if: *is-mesa-main
112
113
114
      changes: &docs-or-ci
      - docs/**/*
      - .gitlab-ci.yml
115
      when: always
116
    # Other cases default to never
117

118
119
test-docs:
  extends: .docs-base
120
121
  # Cancel job if a newer commit is pushed to the same branch
  interruptible: true
122
  stage: deploy
123
124
125
126
127
128
129
130
131
132
133
  needs: []
  rules:
    - *ignore_scheduled_pipelines
    - if: *is-forked-branch
      changes: *docs-or-ci
      when: manual
    # Other cases default to never

test-docs-mr:
  extends:
    - test-docs
134
135
  needs:
    - sanity
136
137
138
  artifacts:
    expose_as: 'Documentation preview'
    paths:
139
    - public/
140
  rules:
141
    - if: *is-pre-merge
142
      changes: *docs-or-ci
143
      when: on_success
144
    # Other cases default to never
145

146
# When to automatically run the CI
147
.ci-run-policy:
148
  rules:
149
    - *ignore_scheduled_pipelines
150
151
152
    # If any files affecting the pipeline are changed, build/test jobs run
    # automatically once all dependency jobs have passed
    - changes: &all_paths
153
      - VERSION
154
155
156
157
      - bin/git_sha1_gen.py
      - bin/install_megadrivers.py
      - bin/meson_get_version.py
      - bin/symbols-check.py
158
159
160
161
162
163
164
165
166
167
168
      # GitLab CI
      - .gitlab-ci.yml
      - .gitlab-ci/**/*
      # Meson
      - meson*
      - build-support/**/*
      - subprojects/**/*
      # Source code
      - include/**/*
      - src/**/*
      when: on_success
169
    # Otherwise, build/test jobs won't run
170
    - when: never
171
172
173
174
  retry:
    max: 2
    when:
      - runner_system_failure
175

176
177
178
success:
  stage: success
  image: debian:stable-slim
179
  rules:
180
    - *ignore_scheduled_pipelines
181
    - if: *is-post-merge
182
      when: never
183
    - if: *is-for-marge
184
185
186
187
      changes: *docs-or-ci
      when: never
    - changes: *all_paths
      when: never
188
    - if: *is-pre-merge
189
      when: on_success
190
191
  variables:
    GIT_STRATEGY: none
192
193
194
195
  script:
    - echo "Dummy job to make sure every merge request pipeline runs at least one job"


196
.ci-deqp-artifacts:
197
  artifacts:
198
    name: "mesa_${CI_JOB_NAME}"
199
200
201
202
203
204
    when: always
    untracked: false
    paths:
      # Watch out!  Artifacts are relative to the build dir.
      # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
      - artifacts
205
      - _build/meson-logs/*.txt
206
      - _build/meson-logs/strace
207

208

209
# Docker image tag helper templates
210
211
212
213
214

.incorporate-templates-commit:
  variables:
    FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_TEMPLATES_COMMIT}"

215
216
217
218
219
.incorporate-base-tag+templates-commit:
  variables:
    FDO_BASE_IMAGE: "${CI_REGISTRY_IMAGE}/${MESA_BASE_IMAGE}:${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
    FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"

220
221
222
223
224
.set-image:
  variables:
    MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_TEMPLATES_COMMIT}"
  image: "$MESA_IMAGE"

225
226
227
228
229
230
231
.set-image-base-tag:
  extends:
    - .set-image
    - .incorporate-base-tag+templates-commit
  variables:
    MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"

232

233
# Build the CI docker images.
234
#
235
# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
236
237
238
239
240
241
242
243
244
245
246
247
248
# image doesn't exist yet, the container stage job generates it.
#
# In order to generate a new image, one should generally change the tag.
# While removing the image from the registry would also work, that's not
# recommended except for ephemeral images during development: Replacing
# an image after a significant amount of time might pull in newer
# versions of gcc/clang or other packages, which might break the build
# with older commits using the same tag.
#
# After merging a change resulting in generating a new image to the
# main repository, it's recommended to remove the image from the source
# repository's container registry, so that the image from the main
# repository's registry will be used there as well.
249

250
.container:
251
  stage: container
252
253
  extends:
    - .ci-run-policy
254
    - .incorporate-templates-commit
255
  rules:
256
    - *ignore_scheduled_pipelines
257
258
    # Run pipeline by default in the main project if any CI pipeline
    # configuration files were changed, to ensure docker images are up to date
259
    - if: *is-post-merge
260
261
262
263
      changes:
      - .gitlab-ci.yml
      - .gitlab-ci/**/*
      when: on_success
264
    # Run pipeline by default if it was triggered by Marge Bot, is for a
265
    # merge request, and any files affecting the pipeline were changed
266
    - if: *is-pre-merge-for-marge
267
268
269
      changes:
        *all_paths
      when: on_success
270
271
    # Run pipeline by default in the main project if it was not triggered by
    # Marge Bot, and any files affecting the pipeline were changed
272
    - if: *is-post-merge-not-for-marge
273
274
275
      changes:
        *all_paths
      when: on_success
276
277
    # Allow triggering jobs manually in other cases if any files affecting the
    # pipeline were changed
278
    - changes:
279
280
281
282
        *all_paths
      when: manual
    # Otherwise, container jobs won't run
    - when: never
283
  variables:
284
    FDO_DISTRIBUTION_VERSION: bullseye-slim
285
    FDO_REPO_SUFFIX: "debian/$CI_JOB_NAME"
286
    FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
287
288
289
    # no need to pull the whole repo to build the container image
    GIT_STRATEGY: none

290
291
292
.use-base-image:
  extends:
    - .container
293
    - .incorporate-base-tag+templates-commit
294
295
296
297
    # Don't want the .container rules
    - .ci-run-policy
  stage: container-2

298
# Debian 11 based x86 build image base
299
x86_build-base:
300
  extends:
301
    - .fdo.container-build@debian
302
    - .container
303
  variables:
304
    MESA_IMAGE_TAG: &x86_build-base "2021-05-31-glslang-tools"
305
306
307

.use-x86_build-base:
  extends:
308
309
    - .fdo.container-build@debian
    - .use-base-image
310
  variables:
311
312
    MESA_BASE_IMAGE: "debian/x86_build-base"
    MESA_BASE_TAG: *x86_build-base
313
    MESA_ARTIFACTS_BASE_TAG: *x86_build-base
314
315
316
  needs:
    - x86_build-base

317
# Debian 11 based x86 main build image
318
319
320
321
x86_build:
  extends:
    - .use-x86_build-base
  variables:
322
    MESA_IMAGE_TAG: &x86_build "2021-06-02-lava-x86"
323

324
.use-x86_build:
325
  extends:
326
    - .set-image-base-tag
327
  variables:
328
    MESA_BASE_TAG: *x86_build-base
329
    MESA_IMAGE_PATH: "debian/x86_build"
330
    MESA_IMAGE_TAG: *x86_build
331
  needs:
332
    - x86_build
333

334
# Debian 11 based i386 cross-build image
335
336
337
338
i386_build:
  extends:
    - .use-x86_build-base
  variables:
339
    MESA_IMAGE_TAG: &i386_build "2021-04-13-bullseye"
340
341

.use-i386_build:
342
  extends:
343
    - .set-image-base-tag
344
  variables:
345
    MESA_BASE_TAG: *x86_build-base
346
    MESA_IMAGE_PATH: "debian/i386_build"
347
    MESA_IMAGE_TAG: *i386_build
348
349
350
  needs:
    - i386_build

351
# Debian 11 based ppc64el cross-build image
352
353
354
355
ppc64el_build:
  extends:
    - .use-x86_build-base
  variables:
356
    MESA_IMAGE_TAG: &ppc64el_build "2021-04-13-bullseye"
357
358

.use-ppc64el_build:
359
  extends:
360
    - .set-image-base-tag
361
  variables:
362
    MESA_BASE_TAG: *x86_build-base
363
    MESA_IMAGE_PATH: "debian/ppc64el_build"
364
    MESA_IMAGE_TAG: *ppc64el_build
365
366
367
  needs:
    - ppc64el_build

368
# Debian 11 based s390x cross-build image
369
370
371
372
s390x_build:
  extends:
    - .use-x86_build-base
  variables:
373
    MESA_IMAGE_TAG: &s390x_build "2021-04-13-bullseye"
374
375

.use-s390x_build:
376
  extends:
377
    - .set-image-base-tag
378
  variables:
379
    MESA_BASE_TAG: *x86_build-base
380
    MESA_IMAGE_PATH: "debian/s390x_build"
381
    MESA_IMAGE_TAG: *s390x_build
382
383
384
  needs:
    - s390x_build

385
386
387
388
389
# Android NDK cross-build image
android_build:
  extends:
    - .use-x86_build-base
  variables:
390
    MESA_IMAGE_TAG: &android_build "2021-04-08-libdrm"
391
392

.use-android_build:
393
  extends:
394
    - .set-image-base-tag
395
  variables:
396
    MESA_BASE_TAG: *x86_build-base
397
    MESA_IMAGE_PATH: "debian/android_build"
398
    MESA_IMAGE_TAG: *android_build
399
400
401
  needs:
    - android_build

402
# Debian 11 based x86 test image base
403
x86_test-base:
404
  extends: x86_build-base
405
  variables:
406
    MESA_IMAGE_TAG: &x86_test-base "2021-03-31-cargo"
407
408
409

.use-x86_test-base:
  extends:
410
411
    - .fdo.container-build@debian
    - .use-base-image
412
  variables:
413
414
    MESA_BASE_IMAGE: "debian/x86_test-base"
    MESA_BASE_TAG: *x86_test-base
415
416
417
  needs:
    - x86_test-base

418
# Debian 11 based x86 test image for GL
419
x86_test-gl:
420
  extends: .use-x86_test-base
421
  variables:
422
423
    FDO_DISTRIBUTION_EXEC: 'env KERNEL_URL=${KERNEL_URL} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
    KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.13-rc5-for-mesa-ci-27df41f1e0cf/linux-v5.13-rc5-for-mesa-ci-27df41f1e0cf.tar.bz2"
424
    MESA_IMAGE_TAG: &x86_test-gl "2021-06-10-piglit"
425

426
# Debian 11 based x86 test image for VK
427
x86_test-vk:
428
  extends: .use-x86_test-base
429
  variables:
430
    MESA_IMAGE_TAG: &x86_test-vk "2021-06-09-piglit"
431

432
# Debian 11 based ARM build image
433
arm_build:
434
  extends:
435
    - .fdo.container-build@debian
436
    - .container
437
438
  tags:
    - aarch64
439
  variables:
440
    MESA_IMAGE_TAG: &arm_build "2021-06-01-lava-x86"
441
442

.use-arm_build:
443
444
  extends:
    - .set-image
445
  variables:
446
    MESA_IMAGE_PATH: "debian/arm_build"
447
    MESA_IMAGE_TAG: *arm_build
448
    MESA_ARTIFACTS_TAG: *arm_build
449
450
  needs:
    - arm_build
451

452
453
454
455
456
457
.kernel+rootfs:
  extends:
    - .ci-run-policy
  stage: container-2
  variables:
    GIT_STRATEGY: fetch
458
    KERNEL_URL: *kernel-rootfs-url
459
    MESA_ROOTFS_TAG: &kernel-rootfs "2021-06-10-piglit"
460
    DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
461
462
463
464
465
466
467
468
469
470
  script:
    - .gitlab-ci/container/lava_build.sh

kernel+rootfs_amd64:
  extends:
    - .use-x86_build-base
    - .kernel+rootfs
  image: "$FDO_BASE_IMAGE"
  variables:
    DEBIAN_ARCH: "amd64"
471
    DISTRIBUTION_TAG: &distribution-tag-amd64 "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
472
473

kernel+rootfs_arm64:
474
475
476
477
478
479
480
481
  extends:
    - .use-arm_build
    - .kernel+rootfs
  tags:
    - aarch64
  variables:
    DEBIAN_ARCH: "arm64"

482
kernel+rootfs_armhf:
483
  extends:
484
    - kernel+rootfs_arm64
485
486
  variables:
    DEBIAN_ARCH: "armhf"
487
488
489
490
491
492
493
494
495
496
497

# Cannot use anchors defined here from included files, so use extends: instead
.use-kernel+rootfs-arm:
  variables:
    DISTRIBUTION_TAG: *distribution-tag-arm
    MESA_ROOTFS_TAG: *kernel-rootfs

.use-kernel+rootfs-amd64:
  variables:
    DISTRIBUTION_TAG: *distribution-tag-amd64
    MESA_ROOTFS_TAG: *kernel-rootfs
498

499
500
# x86 image with ARM64 & armhf kernel & rootfs for baremetal testing
arm_test:
501
  extends:
502
503
504
505
    - .fdo.container-build@debian
    - .container
    # Don't want the .container rules
    - .ci-run-policy
506
507
  stage: build-misc
  needs:
508
509
    - kernel+rootfs_arm64
    - kernel+rootfs_armhf
510
  variables:
511
    FDO_DISTRIBUTION_EXEC: 'env ARTIFACTS_PREFIX=https://${MINIO_HOST}/mesa-lava ARTIFACTS_SUFFIX=${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT} CI_PROJECT_PATH=${CI_PROJECT_PATH} FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} FDO_UPSTREAM_REPO=${FDO_UPSTREAM_REPO} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
512
    FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
513
    MESA_ARM_BUILD_TAG: *arm_build
514
    MESA_IMAGE_TAG: &arm_test "2021-04-20-kernel-modules"
515
    MESA_ROOTFS_TAG: *kernel-rootfs
516

517
518
.use-arm_test:
  image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
519
  variables:
520
521
522
    MESA_ARM_BUILD_TAG: *arm_build
    MESA_IMAGE_PATH: "debian/arm_test"
    MESA_IMAGE_TAG: *arm_test
523
    MESA_ROOTFS_TAG: *kernel-rootfs
524
  needs:
525
    - arm_test
526

527
# Native Windows docker builds
528
#
Matt Turner's avatar
Matt Turner committed
529
# Unlike the above Linux-based builds - including MinGW builds which
530
531
532
533
534
535
536
537
538
539
# cross-compile for Windows - which use the freedesktop ci-templates, we
# cannot use the same scheme here. As Windows lacks support for
# Docker-in-Docker, and Podman does not run natively on Windows, we have
# to open-code much of the same ourselves.
#
# This is achieved by first running in a native Windows shell instance
# (host PowerShell) in the container stage to build and push the image,
# then in the build stage by executing inside Docker.

.windows-docker-vs2019:
540
541
  extends:
    - .set-image
542
  variables:
543
    MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}"
544
    MESA_IMAGE_PATH: "windows/x64_build"
545
    MESA_IMAGE_TAG: "2021-04-14-radv"
546
    MESA_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MESA_IMAGE_PATH:${MESA_IMAGE_TAG}"
547

548
windows_build_vs2019:
549
550
551
  extends:
    - .container
    - .windows-docker-vs2019
552
  stage: container
553
554
  variables:
    GIT_STRATEGY: fetch # we do actually need the full repository though
555
  timeout: 2h 30m # LLVM + piglit takes ages
556
557
558
559
  tags:
    - windows
    - shell
    - "1809"
560
    - mesa
561
  script:
562
    - .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $MESA_IMAGE $MESA_UPSTREAM_IMAGE
563

564
565
.use-windows_build_vs2019:
  extends: .windows-docker-vs2019
566
  image: "$MESA_IMAGE"
567
  needs:
568
    - windows_build_vs2019
569

570
571
572
573

# Git archive

make git archive:
574
575
  extends:
    - .fdo.ci-fairy
576
  stage: git-archive
577
  rules:
578
    - if: *is-scheduled-pipeline
579
      when: on_success
580
581
582
583
  # ensure we are running on packet
  tags:
    - packet.net
  script:
584
585
    # Compactify the .git directory
    - git gc --aggressive
586
587
588
589
590
    # compress the current folder
    - tar -cvzf ../$CI_PROJECT_NAME.tar.gz .

    # login with the JWT token
    - ci-fairy minio login $CI_JOB_JWT
591
    - ci-fairy minio cp ../$CI_PROJECT_NAME.tar.gz minio://$MINIO_HOST/git-cache/$CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME/$CI_PROJECT_NAME.tar.gz
592
593


594
# Sanity checks of MR settings and commit logs
595
sanity:
596
597
  extends:
    - .fdo.ci-fairy
598
599
  stage: sanity
  rules:
600
    - if: *is-pre-merge
601
602
      when: on_success
    # Other cases default to never
603
604
  variables:
    GIT_STRATEGY: none
605
  script:
Samuel Pitoiset's avatar
Samuel Pitoiset committed
606
    # ci-fairy check-commits --junit-xml=check-commits.xml
607
608
609
610
611
    - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
  artifacts:
    when: on_failure
    reports:
      junit: check-*.xml
612
613


614
615
# BUILD

616
617
# Shared between windows and Linux
.build-common:
618
  extends: .ci-run-policy
619
620
  # Cancel job if a newer commit is pushed to the same branch
  interruptible: true
621
  artifacts:
622
    name: "mesa_${CI_JOB_NAME}"
623
624
625
    when: always
    paths:
      - _build/meson-logs/*.txt
626
      - _build/meson-logs/strace
627
      - shader-db
628
629
630
631

# Just Linux
.build-linux:
  extends: .build-common
632
633
  variables:
    CCACHE_COMPILERCHECK: "content"
634
635
    CCACHE_COMPRESS: "true"
    CCACHE_DIR: /cache/mesa/ccache
636
637
638
639
  # Use ccache transparently, and print stats before/after
  before_script:
    - export PATH="/usr/lib/ccache:$PATH"
    - export CCACHE_BASEDIR="$PWD"
640
    - ccache --show-stats
641
642
  after_script:
    - ccache --show-stats
643

644
645
646
.build-windows:
  extends: .build-common
  tags:
647
648
649
    - windows
    - docker
    - "1809"
650
    - mesa
651
652
653
654
655
  cache:
    key: ${CI_JOB_NAME}
    paths:
      - subprojects/packagecache

656
.meson-build:
657
  extends:
658
    - .build-linux
659
    - .use-x86_build
660
  stage: meson-x86_64
661
  variables:
662
    LLVM_VERSION: 11
663
  script:
664
    - .gitlab-ci/meson/build.sh
665

666
meson-testing:
667
668
669
  extends:
    - .meson-build
    - .ci-deqp-artifacts
670
  variables:
671
    UNWIND: "enabled"
672
673
    DRI_LOADERS: >
      -D glx=dri
674
675
      -D gbm=enabled
      -D egl=enabled
676
      -D platforms=x11
677
    GALLIUM_ST: >
678
      -D dri3=enabled
679
    GALLIUM_DRIVERS: "swrast,virgl,radeonsi,zink,iris,i915"
Dave Airlie's avatar
Dave Airlie committed
680
    VULKAN_DRIVERS: "swrast,amd"
681
    BUILDTYPE: "debugoptimized"
682
    EXTRA_OPTION: >
683
      -D valgrind=false
684
    MINIO_ARTIFACT_NAME: mesa-amd64
685
  script:
686
    - .gitlab-ci/meson/build.sh
687
688
    - .gitlab-ci/prepare-artifacts.sh

Emma Anholt's avatar
Emma Anholt committed
689
690
691
692
meson-testing-asan:
  extends:
    - meson-testing
  variables:
693
694
    C_ARGS: >
      -Wno-error=stringop-truncation
Emma Anholt's avatar
Emma Anholt committed
695
696
    EXTRA_OPTION: >
      -D b_sanitize=address
697
      -D valgrind=false
698
    MINIO_ARTIFACT_NAME: ""
699
    ARTIFACTS_DEBUG_SYMBOLS: 1
Emma Anholt's avatar
Emma Anholt committed
700

701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
meson-clover-testing:
  extends:
    - .meson-build
    - .ci-deqp-artifacts
  variables:
    UNWIND: "enabled"
    DRI_LOADERS: >
      -D glx=disabled
      -D egl=disabled
      -D gbm=disabled
    GALLIUM_ST: >
      -D gallium-opencl=icd
      -D opencl-spirv=true
    GALLIUM_DRIVERS: "swrast"
    BUILDTYPE: "debugoptimized"
716
    EXTRA_OPTION: >
717
      -D valgrind=false
718
  script:
719
    - .gitlab-ci/meson/build.sh
720
721
    - .gitlab-ci/prepare-artifacts.sh

722
meson-gallium:
723
  extends: .meson-build
724
  variables:
725
    UNWIND: "enabled"
726
727
    DRI_LOADERS: >
      -D glx=dri
728
729
      -D gbm=enabled
      -D egl=enabled
730
      -D platforms=x11,wayland
731
    GALLIUM_ST: >
732
      -D dri3=enabled
733
      -D gallium-extra-hud=true
734
735
      -D gallium-vdpau=enabled
      -D gallium-xvmc=enabled
736
      -D gallium-omx=bellagio
737
738
      -D gallium-va=enabled
      -D gallium-xa=enabled
739
740
      -D gallium-nine=true
      -D gallium-opencl=disabled
741
    GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swr,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,asahi,crocus"
742
    VULKAN_DRIVERS: swrast
743
    EXTRA_OPTION: >
Emma Anholt's avatar
Emma Anholt committed
744
      -D osmesa=true
745
      -D tools=all
746
  script:
747
    - .gitlab-ci/meson/build.sh
748
    - .gitlab-ci/run-shader-db.sh
749
    - src/freedreno/.gitlab-ci/run-fdtools.sh
750

751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
# Test a release build with -Werror so new warnings don't sneak in.
meson-release:
  extends: .meson-build
  variables:
    UNWIND: "enabled"
    DRI_LOADERS: >
      -D glx=dri
      -D gbm=enabled
      -D egl=enabled
      -D platforms=x11,wayland
    GALLIUM_ST: >
      -D dri3=enabled
      -D gallium-extra-hud=true
      -D gallium-vdpau=enabled
      -D gallium-xvmc=disabled
      -D gallium-omx=disabled
      -D gallium-va=enabled
      -D gallium-xa=enabled
      -D gallium-nine=false
      -D gallium-opencl=disabled
      -D llvm=false
772
    GALLIUM_DRIVERS: "iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12,crocus"
773
774
    BUILDTYPE: "release"
    EXTRA_OPTION: >
775
      -D osmesa=true
776
777
      -D tools=all
  script:
778
    - .gitlab-ci/meson/build.sh
779

780
meson-android:
781
782
783
  extends:
    - .meson-cross
    - .use-android_build
784
785
  variables:
    UNWIND: "disabled"
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
    C_ARGS: >
      -Wno-error=absolute-value
      -Wno-error=asm-operand-widths
      -Wno-error=constant-conversion
      -Wno-error=enum-conversion
      -Wno-error=extern-initializer
      -Wno-error=initializer-overrides
      -Wno-error=missing-braces
      -Wno-error=sometimes-uninitialized
      -Wno-error=tautological-constant-out-of-range-compare
      -Wno-error=unused-function
      -Wno-error=unused-label
    CPP_ARGS: >
      -Wno-error=deprecated-declarations
      -Wno-error=non-virtual-dtor
801
802
803
804
805
806
807
    DRI_LOADERS: >
      -D glx=disabled
      -D gbm=disabled
      -D egl=enabled
      -D platforms=android
    EXTRA_OPTION: >
      -D android-stub=true
808
      -D llvm=disabled
809
      -D platform-sdk-version=29
810
      -D valgrind=false
811
812
813
814
815
816
817
818
819
    GALLIUM_ST: >
      -D dri3=disabled
      -D gallium-vdpau=disabled
      -D gallium-xvmc=disabled
      -D gallium-omx=disabled
      -D gallium-va=disabled
      -D gallium-xa=disabled
      -D gallium-nine=false
      -D gallium-opencl=disabled
820
    LLVM_VERSION: ""
821
    PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
822
  script:
823
    - PKG_CONFIG_PATH=/usr/local/lib/aarch64-linux-android/pkgconfig/:/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/pkgconfig/ CROSS=aarch64-linux-android GALLIUM_DRIVERS=etnaviv,freedreno,lima,panfrost,vc4,v3d VULKAN_DRIVERS=freedreno,broadcom,virtio-experimental .gitlab-ci/meson/build.sh
824
825
826
827
    # x86_64 build:
    # Can't do Intel because gen_decoder.c currently requires libexpat, which
    # is not a dependency that AOSP wants to accept.  Can't do Radeon because
    # it requires LLVM, which we don't have an Android build of.
828
    # - PKG_CONFIG_PATH=/usr/local/lib/x86_64-linux-android/pkgconfig/ CROSS=x86_64-linux-android GALLIUM_DRIVERS=iris VULKAN_DRIVERS=intel .gitlab-ci/meson/build.sh
829

830
831
832
.meson-cross:
  extends:
    - .meson-build
833
  stage: build-misc
834
  variables:
835
    UNWIND: "disabled"
836
    DRI_LOADERS: >
837
      -D glx=dri
Christian Gmeiner's avatar
Christian Gmeiner committed
838
      -D gbm=enabled
839
      -D egl=enabled
840
      -D platforms=x11
Emma Anholt's avatar
Emma Anholt committed
841
      -D osmesa=false
842
    GALLIUM_ST: >
843
      -D dri3=enabled
844
845
      -D gallium-vdpau=disabled
      -D gallium-xvmc=disabled
846
      -D gallium-omx=disabled
847
848
      -D gallium-va=disabled
      -D gallium-xa=disabled
849
850
      -D gallium-nine=false

851
.meson-arm:
852
853
854
  extends:
    - .meson-cross
    - .use-arm_build
855
856
  needs:
    - arm_build
857
  variables:
858
    VULKAN_DRIVERS: freedreno,broadcom
859
    GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
860
    BUILDTYPE: "debugoptimized"
861
862
863
864
  tags:
    - aarch64

meson-armhf:
865
866
867
  extends:
    - .meson-arm
    - .ci-deqp-artifacts
868
869
  variables:
    CROSS: armhf
870
    EXTRA_OPTION: >
871
      -D llvm=disabled
872
      -D valgrind=false
873
    MINIO_ARTIFACT_NAME: mesa-armhf
874
  script:
875
    - .gitlab-ci/meson/build.sh
876
    - .gitlab-ci/prepare-artifacts.sh
877
878

meson-arm64:
879
880
881
  extends:
    - .meson-arm
    - .ci-deqp-artifacts
882
  variables:
883
    VULKAN_DRIVERS: "freedreno,broadcom"
884
    EXTRA_OPTION: >
885
      -D llvm=disabled
886
      -D valgrind=false
887
    MINIO_ARTIFACT_NAME: mesa-arm64
888
  script:
889
    - .gitlab-ci/meson/build.sh
890
    - .gitlab-ci/prepare-artifacts.sh
891

892
893
894
895
meson-arm64-asan:
  extends:
    - meson-arm64
  variables:
Michel Dänzer's avatar