.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

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

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

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

61
62
63
64
# YAML anchors for rule conditions
# --------------------------------
.rules-anchors:
  rules:
65
66
67
    # For Marge Bot
    - if: &is-for-marge '$GITLAB_USER_LOGIN == "marge-bot"'
      when: never
68
    # Forked project branch
69
    - if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
70
      when: manual
71
72
    # 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)'
73
      when: manual
74
75
    # 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'
76
      when: always
77
78
79
    # Post-merge pipeline
    - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
      when: on_success
80
    # Post-merge pipeline, not for Marge Bot
81
    - 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'
82
      when: on_success
83
84
85
    # Pre-merge pipeline
    - if: &is-pre-merge '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
      when: on_success
86
87
88
    # 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
89
90


91
.docs-base:
92
93
94
  extends:
    - .fdo.ci-fairy
    - .ci-run-policy
95
  script:
96
  - apk --no-cache add graphviz
Erik Faye-Lund's avatar
Erik Faye-Lund committed
97
  - pip3 install "sphinx<4.0" sphinx_rtd_theme
98
  - sphinx-build -W -b html docs public
99
100
101

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

116
117
test-docs:
  extends: .docs-base
118
119
  # Cancel job if a newer commit is pushed to the same branch
  interruptible: true
120
  stage: deploy
121
122
123
124
125
126
127
128
129
130
131
  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
132
133
  needs:
    - sanity
134
135
136
  artifacts:
    expose_as: 'Documentation preview'
    paths:
137
    - public/
138
  rules:
139
    - if: *is-pre-merge
140
      changes: *docs-or-ci
141
      when: on_success
142
    # Other cases default to never
143

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

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


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

206

207
# Docker image tag helper templates
208
209
210
211
212

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

213
214
215
216
217
.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}"

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

223
224
225
226
227
228
229
.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}"

230

231
# Build the CI docker images.
232
#
233
# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
234
235
236
237
238
239
240
241
242
243
244
245
246
# 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.
247

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

416
# Debian 11 based x86 test image for GL
417
x86_test-gl:
418
  extends: .use-x86_test-base
419
  variables:
420
421
    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"
422
    MESA_IMAGE_TAG: &x86_test-gl "2021-06-10-piglit"
423

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

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

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

450
451
452
453
454
455
.kernel+rootfs:
  extends:
    - .ci-run-policy
  stage: container-2
  variables:
    GIT_STRATEGY: fetch
456
    KERNEL_URL: *kernel-rootfs-url
457
    MESA_ROOTFS_TAG: &kernel-rootfs "2021-06-10-piglit"
458
    DISTRIBUTION_TAG: &distribution-tag-arm "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
459
460
461
462
463
464
465
466
467
468
  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"
469
    DISTRIBUTION_TAG: &distribution-tag-amd64 "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_BASE_TAG}--${MESA_TEMPLATES_COMMIT}"
470
471

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

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

# 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
496

497
498
# x86 image with ARM64 & armhf kernel & rootfs for baremetal testing
arm_test:
499
  extends:
500
501
502
503
    - .fdo.container-build@debian
    - .container
    # Don't want the .container rules
    - .ci-run-policy
504
505
  stage: build-misc
  needs:
506
507
    - kernel+rootfs_arm64
    - kernel+rootfs_armhf
508
  variables:
509
    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'
510
    FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
511
    MESA_ARM_BUILD_TAG: *arm_build
512
    MESA_IMAGE_TAG: &arm_test "2021-04-20-kernel-modules"
513
    MESA_ROOTFS_TAG: *kernel-rootfs
514

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

525
# Native Windows docker builds
526
#
Matt Turner's avatar
Matt Turner committed
527
# Unlike the above Linux-based builds - including MinGW builds which
528
529
530
531
532
533
534
535
536
537
# 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:
538
539
  extends:
    - .set-image
540
  variables:
541
    MESA_IMAGE: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}"
542
    MESA_IMAGE_PATH: "windows/x64_build"
543
    MESA_IMAGE_TAG: "2021-04-14-radv"
544
    MESA_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/$MESA_IMAGE_PATH:${MESA_IMAGE_TAG}"
545

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

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

568
569
570
571

# Git archive

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

    # login with the JWT token
    - ci-fairy minio login $CI_JOB_JWT
589
    - 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
590
591


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


612
613
# BUILD

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

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

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

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

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

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

699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
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"
714
    EXTRA_OPTION: >
715
      -D valgrind=false
716
  script:
717
    - .gitlab-ci/meson/build.sh
718
719
    - .gitlab-ci/prepare-artifacts.sh

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

749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# 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
770
    GALLIUM_DRIVERS: "iris,nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,d3d12"
771
772
    BUILDTYPE: "release"
    EXTRA_OPTION: >
773
      -D osmesa=true
774
775
      -D tools=all
  script:
776
    - .gitlab-ci/meson/build.sh
777

778
meson-android:
779
780
781
  extends:
    - .meson-cross
    - .use-android_build
782
783
  variables:
    UNWIND: "disabled"
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
    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
799
800
801
802
803
804
805
    DRI_LOADERS: >
      -D glx=disabled
      -D gbm=disabled
      -D egl=enabled
      -D platforms=android
    EXTRA_OPTION: >
      -D android-stub=true
806
      -D llvm=disabled
807
      -D platform-sdk-version=29
808
      -D valgrind=false
809
810
811
812
813
814
815
816
817
    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
818
    LLVM_VERSION: ""
819
    PKG_CONFIG_LIBDIR: "/disable/non/android/system/pc/files"
820
  script:
821
    - 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
822
823
824
825
    # 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.
826
    # - 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
827

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

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

meson-armhf:
863
864
865
  extends:
    - .meson-arm
    - .ci-deqp-artifacts
866
867
  variables:
    CROSS: armhf
868
    EXTRA_OPTION: >
869
      -D llvm=disabled
870
      -D valgrind=false