.gitlab-ci.yml 40.1 KB
Newer Older
1
variables:
2
  FDO_UPSTREAM_REPO: mesa/mesa
3
  MESA_TEMPLATES_COMMIT: &ci-templates-commit 43ac932d5b8ebf43040d302de3c6e734df178384
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

include:
11
  - project: 'freedesktop/ci-templates'
12
    ref: *ci-templates-commit
13
    file:
14
      - '/templates/ci-fairy.yml'
15 16 17
  - project: 'freedesktop/ci-templates'
    ref: 52dd4a94044449c8481d18dcdc221a3c636366d2
    file:
18
      - '/templates/debian.yml'
19
  - local: '.gitlab-ci/lava-gitlab-ci.yml'
20
  - local: '.gitlab-ci/test-source-dep.yml'
21

22
stages:
23
  - sanity
24
  - container
25
  - container-2
26
  - git-archive
27
  - meson-x86_64
28
  - build-misc
29
  - amd
30 31
  - arm
  - freedreno
32
  - raspberrypi
33
  - software-renderer
34
  - layered-backends
35
  - deploy
36
  - success
37

38 39 40 41
# Generic rule to not run the job during scheduled pipelines
# ----------------------------------------------------------
.scheduled_pipelines-rules:
  rules: &ignore_scheduled_pipelines
42
    if: &is-scheduled-pipeline '$CI_PIPELINE_SOURCE == "schedule"'
43 44
    when: never

45 46 47 48
# YAML anchors for rule conditions
# --------------------------------
.rules-anchors:
  rules:
49 50 51
    # For Marge Bot
    - if: &is-for-marge '$GITLAB_USER_LOGIN == "marge-bot"'
      when: never
52
    # Forked project branch
53
    - if: &is-forked-branch '$CI_PROJECT_NAMESPACE != "mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
54
      when: manual
55
    # Forked project branch / pre-merge pipeline
56
    - if: &is-forked-branch-or-pre-merge '$CI_PROJECT_NAMESPACE != "mesa" || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
57
      when: manual
58
    # Pipeline runs for the master branch of the main project
59
    - if: &is-main-master '$CI_PROJECT_NAMESPACE == "mesa" && $CI_COMMIT_REF_NAME == "master" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != "master"'
60
      when: always
61 62 63
    # Post-merge pipeline
    - if: &is-post-merge '$CI_PROJECT_NAMESPACE == "mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
      when: on_success
64
    # Post-merge pipeline, not for Marge Bot
65
    - 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'
66
      when: on_success
67 68 69
    # Pre-merge pipeline
    - if: &is-pre-merge '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
      when: on_success
70 71 72
    # 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
73 74


75
.docs-base:
76 77 78
  extends:
    - .fdo.ci-fairy
    - .ci-run-policy
79
  script:
80
  - apk --no-cache add graphviz
81 82
  - pip3 install sphinx sphinx_rtd_theme
  - sphinx-build -b html docs public
83 84 85

pages:
  extends: .docs-base
86
  stage: deploy
87 88 89
  artifacts:
    paths:
    - public
90
  needs: []
91
  rules:
92
    - *ignore_scheduled_pipelines
93
    - if: *is-main-master
94 95 96
      changes: &docs-or-ci
      - docs/**/*
      - .gitlab-ci.yml
97
      when: always
98
    # Other cases default to never
99

100 101
test-docs:
  extends: .docs-base
102 103
  # Cancel job if a newer commit is pushed to the same branch
  interruptible: true
104
  stage: deploy
105 106 107 108 109 110 111 112 113 114 115
  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
116 117
  needs:
    - sanity
118
  rules:
119
    - if: *is-pre-merge-for-marge
120
      changes: *docs-or-ci
121
      when: on_success
122
    - if: *is-pre-merge
123
      changes: *docs-or-ci
124 125
      when: manual
    # Other cases default to never
126

127
# When to automatically run the CI
128
.ci-run-policy:
129
  rules:
130
    - *ignore_scheduled_pipelines
131 132 133
    # If any files affecting the pipeline are changed, build/test jobs run
    # automatically once all dependency jobs have passed
    - changes: &all_paths
134
      - VERSION
135 136 137 138
      - bin/git_sha1_gen.py
      - bin/install_megadrivers.py
      - bin/meson_get_version.py
      - bin/symbols-check.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
      # GitLab CI
      - .gitlab-ci.yml
      - .gitlab-ci/**/*
      # Meson
      - meson*
      - build-support/**/*
      - subprojects/**/*
      # SCons
      - SConstruct
      - scons/**/*
      - common.py
      # Source code
      - include/**/*
      - src/**/*
      when: on_success
154
    # Otherwise, build/test jobs won't run
155
    - when: never
156 157 158 159
  retry:
    max: 2
    when:
      - runner_system_failure
160

161 162 163
success:
  stage: success
  image: debian:stable-slim
164
  rules:
165
    - *ignore_scheduled_pipelines
166
    - if: *is-post-merge
167
      when: never
168
    - if: *is-for-marge
169 170 171 172
      changes: *docs-or-ci
      when: never
    - changes: *all_paths
      when: never
173
    - if: *is-pre-merge
174
      when: on_success
175 176
  variables:
    GIT_STRATEGY: none
177 178 179 180
  script:
    - echo "Dummy job to make sure every merge request pipeline runs at least one job"


181
.ci-deqp-artifacts:
182
  artifacts:
183
    name: "mesa_${CI_JOB_NAME}"
184 185 186 187 188 189
    when: always
    untracked: false
    paths:
      # Watch out!  Artifacts are relative to the build dir.
      # https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
      - artifacts
190

191
# Build the CI docker images.
192
#
193
# MESA_IMAGE_TAG is the tag of the docker image used by later stage jobs. If the
194 195 196 197 198 199 200 201 202 203 204 205 206
# 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.
207

208
.container:
209
  stage: container
210 211
  extends:
    - .ci-run-policy
212
  rules:
213
    - *ignore_scheduled_pipelines
214 215
    # Run pipeline by default in the main project if any CI pipeline
    # configuration files were changed, to ensure docker images are up to date
216
    - if: *is-post-merge
217 218 219 220
      changes:
      - .gitlab-ci.yml
      - .gitlab-ci/**/*
      when: on_success
221
    # Run pipeline by default if it was triggered by Marge Bot, is for a
222
    # merge request, and any files affecting the pipeline were changed
223
    - if: *is-pre-merge-for-marge
224 225 226
      changes:
        *all_paths
      when: on_success
227 228
    # Run pipeline by default in the main project if it was not triggered by
    # Marge Bot, and any files affecting the pipeline were changed
229
    - if: *is-post-merge-not-for-marge
230 231 232
      changes:
        *all_paths
      when: on_success
233 234
    # Allow triggering jobs manually in other cases if any files affecting the
    # pipeline were changed
235
    - changes:
236 237 238 239
        *all_paths
      when: manual
    # Otherwise, container jobs won't run
    - when: never
240
  variables:
241
    FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}-${MESA_TEMPLATES_COMMIT}"
242
    FDO_DISTRIBUTION_VERSION: buster-slim
243
    FDO_REPO_SUFFIX: "debian/$CI_JOB_NAME"
244
    FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/container/${CI_JOB_NAME}.sh'
245 246 247
    # no need to pull the whole repo to build the container image
    GIT_STRATEGY: none

248 249 250 251 252 253 254 255 256
.use-base-image:
  extends:
    - .container
    # Don't want the .container rules
    - .ci-run-policy
  stage: container-2
  variables:
    FDO_BASE_IMAGE: "${CI_REGISTRY_IMAGE}/${MESA_BASE_IMAGE}:${MESA_BASE_TAG}-${MESA_TEMPLATES_COMMIT}"

257 258
# Debian 10 based x86 build image base
x86_build-base:
259
  extends:
260
    - .fdo.container-build@debian
261
    - .container
262
  variables:
263
    MESA_IMAGE_TAG: &x86_build-base "2020-12-17-use-ephemeral"
264 265 266

.use-x86_build-base:
  extends:
267 268
    - .fdo.container-build@debian
    - .use-base-image
269
  variables:
270 271
    MESA_BASE_IMAGE: "debian/x86_build-base"
    MESA_BASE_TAG: *x86_build-base
272 273 274 275 276 277 278 279
  needs:
    - x86_build-base

# Debian 10 based x86 main build image
x86_build:
  extends:
    - .use-x86_build-base
  variables:
280
    MESA_IMAGE_TAG: &x86_build "2020-12-17-use-ephemeral"
281

282
.use-x86_build:
283 284
  variables:
    TAG: *x86_build
285
  image: "$CI_REGISTRY_IMAGE/debian/x86_build:${TAG}-${MESA_TEMPLATES_COMMIT}"
286
  needs:
287
    - x86_build
288

289 290 291 292 293
# Debian 10 based i386 cross-build image
i386_build:
  extends:
    - .use-x86_build-base
  variables:
294
    MESA_IMAGE_TAG: &i386_build "2020-12-23-opengl"
295 296 297 298

.use-i386_build:
  variables:
    TAG: *i386_build
299
  image: "$CI_REGISTRY_IMAGE/debian/i386_build:${TAG}-${MESA_TEMPLATES_COMMIT}"
300 301 302 303 304 305 306 307
  needs:
    - i386_build

# Debian 10 based ppc64el cross-build image
ppc64el_build:
  extends:
    - .use-x86_build-base
  variables:
308
    MESA_IMAGE_TAG: &ppc64el_build "2020-12-23-opengl"
309 310 311 312

.use-ppc64el_build:
  variables:
    TAG: *ppc64el_build
313
  image: "$CI_REGISTRY_IMAGE/debian/ppc64el_build:${TAG}-${MESA_TEMPLATES_COMMIT}"
314 315 316 317 318 319 320 321
  needs:
    - ppc64el_build

# Debian 10 based s390x cross-build image
s390x_build:
  extends:
    - .use-x86_build-base
  variables:
322
    MESA_IMAGE_TAG: &s390x_build "2020-12-23-opengl"
323 324 325 326

.use-s390x_build:
  variables:
    TAG: *s390x_build
327
  image: "$CI_REGISTRY_IMAGE/debian/s390x_build:${TAG}-${MESA_TEMPLATES_COMMIT}"
328 329 330
  needs:
    - s390x_build

331 332 333 334 335
# Android NDK cross-build image
android_build:
  extends:
    - .use-x86_build-base
  variables:
336
    MESA_IMAGE_TAG: &android_build "2020-12-17-use-ephemeral"
337 338 339 340

.use-android_build:
  variables:
    TAG: *android_build
341
  image: "$CI_REGISTRY_IMAGE/debian/android_build:${TAG}-${MESA_TEMPLATES_COMMIT}"
342 343 344
  needs:
    - android_build

345 346
# Debian 10 based x86 test image base
x86_test-base:
347
  extends: x86_build-base
348
  variables:
349
    MESA_IMAGE_TAG: &x86_test-base "2020-12-17-install-ci-fairy"
350 351 352

.use-x86_test-base:
  extends:
353 354
    - .fdo.container-build@debian
    - .use-base-image
355
  variables:
356 357
    MESA_BASE_IMAGE: "debian/x86_test-base"
    MESA_BASE_TAG: *x86_test-base
358 359 360
  needs:
    - x86_test-base

361 362
# Debian 10 based x86 test image for GL
x86_test-gl:
363
  extends: .use-x86_test-base
364
  variables:
365
    MESA_IMAGE_TAG: &x86_test-gl "2020-12-22-runner"
366

367 368
# Debian 10 based x86 test image for VK
x86_test-vk:
369
  extends: .use-x86_test-base
370
  variables:
371
    MESA_IMAGE_TAG: &x86_test-vk "2020-12-22-runner"
372

373
# Debian 10 based ARM build image
374
arm_build:
375
  extends:
376
    - .fdo.container-build@debian@arm64v8
377
    - .container
378
  variables:
379
    MESA_IMAGE_TAG: &arm_build "2020-12-23-opengl"
380 381 382 383

.use-arm_build:
  variables:
    TAG: *arm_build
384
  image: "$CI_REGISTRY_IMAGE/debian/arm_build:${TAG}-${MESA_TEMPLATES_COMMIT}"
385 386
  needs:
    - arm_build
387

388 389 390 391 392 393
# Debian 10 based x86 baremetal image base
arm_test-base:
  extends:
    - .fdo.container-build@debian
    - .container
  variables:
394
    MESA_IMAGE_TAG: &arm_test-base "2020-12-03-expect"
395 396 397

.use-arm_test-base:
  extends:
398 399
    - .fdo.container-build@debian
    - .use-base-image
400
  variables:
401 402
    MESA_BASE_IMAGE: "debian/arm_test-base"
    MESA_BASE_TAG: *arm_test-base
403 404 405
  needs:
    - arm_test-base

406 407
# x86 image with ARM64 rootfs for baremetal testing.
arm64_test:
408 409
  extends:
    - .use-arm_test-base
410
  variables:
411
    MESA_IMAGE_TAG: &arm64_test "2020-12-22-runner"
412

413
.use-arm64_test:
414
  variables:
415
    TAG: *arm64_test
416
  image: "$CI_REGISTRY_IMAGE/debian/arm64_test:${TAG}-${MESA_TEMPLATES_COMMIT}"
417
  needs:
418
    - arm64_test
419

420 421 422 423 424
# x86 image with armhf rootfs for baremetal testing
armhf_test:
  extends:
    - .use-arm_test-base
  variables:
425
    MESA_IMAGE_TAG: &armhf_test "2020-12-22-runner"
426 427 428 429

.use-armhf_test:
  variables:
    TAG: *armhf_test
430
  image: "$CI_REGISTRY_IMAGE/debian/armhf_test:${TAG}-${MESA_TEMPLATES_COMMIT}"
431 432 433
  needs:
    - armhf_test

434
# Native Windows docker builds
435
#
436 437 438 439 440 441 442 443 444 445 446 447
# Unlike the above Linux-based builds - including MinGW/SCons builds which
# 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:
  variables:
448
    WINDOWS_TAG: "2020-12-02"
449 450
    WINDOWS_IMAGE: "$CI_REGISTRY_IMAGE/windows/x64_build:${WINDOWS_TAG}-${MESA_TEMPLATES_COMMIT}"
    WINDOWS_UPSTREAM_IMAGE: "$CI_REGISTRY/$FDO_UPSTREAM_REPO/windows/x64_build:${WINDOWS_TAG}-${MESA_TEMPLATES_COMMIT}"
451

Daniel Stone's avatar
Daniel Stone committed
452
windows_build_vs2019:
453 454 455
  extends:
    - .container
    - .windows-docker-vs2019
456
  stage: container
457 458
  variables:
    GIT_STRATEGY: fetch # we do actually need the full repository though
459
  timeout: 2h # LLVM + piglit takes ages
460 461 462 463
  tags:
    - windows
    - shell
    - "1809"
464
    - mesa
465 466
  script:
    - .\.gitlab-ci\windows\mesa_container.ps1 $CI_REGISTRY $CI_REGISTRY_USER $CI_REGISTRY_PASSWORD $WINDOWS_IMAGE $WINDOWS_UPSTREAM_IMAGE
467

468 469 470 471
.use-windows_build_vs2019:
  extends: .windows-docker-vs2019
  image: "$WINDOWS_IMAGE"
  needs:
472
    - windows_build_vs2019
473

474 475 476 477

# Git archive

make git archive:
478 479
  extends:
    - .fdo.ci-fairy
480
  stage: git-archive
481
  rules:
482
    - if: *is-scheduled-pipeline
483
      when: on_success
484 485 486 487
  # ensure we are running on packet
  tags:
    - packet.net
  script:
488 489
    # Compactify the .git directory
    - git gc --aggressive
490 491 492 493 494
    # compress the current folder
    - tar -cvzf ../$CI_PROJECT_NAME.tar.gz .

    # login with the JWT token
    - ci-fairy minio login $CI_JOB_JWT
495
    - 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
496 497


498
# Sanity checks of MR settings and commit logs
499
sanity:
500 501
  extends:
    - .fdo.ci-fairy
502 503
  stage: sanity
  rules:
504
    - if: *is-pre-merge
505 506
      when: on_success
    # Other cases default to never
507 508
  variables:
    GIT_STRATEGY: none
509
  script:
Samuel Pitoiset's avatar
Samuel Pitoiset committed
510
    # ci-fairy check-commits --junit-xml=check-commits.xml
511 512 513 514 515
    - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml
  artifacts:
    when: on_failure
    reports:
      junit: check-*.xml
516 517


518 519
# BUILD

520 521
# Shared between windows and Linux
.build-common:
522
  extends: .ci-run-policy
523 524
  # Cancel job if a newer commit is pushed to the same branch
  interruptible: true
525
  artifacts:
526
    name: "mesa_${CI_JOB_NAME}"
527 528 529 530
    when: always
    paths:
      - _build/meson-logs/*.txt
      # scons:
531
      - build/*/config.log
532
      - shader-db
533 534 535 536

# Just Linux
.build-linux:
  extends: .build-common
537 538
  variables:
    CCACHE_COMPILERCHECK: "content"
539 540
    CCACHE_COMPRESS: "true"
    CCACHE_DIR: /cache/mesa/ccache
541 542 543 544
  # Use ccache transparently, and print stats before/after
  before_script:
    - export PATH="/usr/lib/ccache:$PATH"
    - export CCACHE_BASEDIR="$PWD"
545
    - ccache --show-stats
546 547
  after_script:
    - ccache --show-stats
548

549 550 551
.build-windows:
  extends: .build-common
  tags:
552 553 554
    - windows
    - docker
    - "1809"
555
    - mesa
556 557 558 559 560
  cache:
    key: ${CI_JOB_NAME}
    paths:
      - subprojects/packagecache

561
.meson-build:
562
  extends:
563
    - .build-linux
564
    - .use-x86_build
565
  stage: meson-x86_64
566
  variables:
567
    LLVM_VERSION: 10
568
  script:
569
    - .gitlab-ci/meson-build.sh
570

571
.scons-build:
572
  extends:
573
    - .build-linux
574
    - .use-x86_build
575
  stage: build-misc
576
  script:
577
    - env SCONSFLAGS="-j${FDO_CI_CONCURRENT:-4}" .gitlab-ci/scons-build.sh
578

579
meson-testing:
580 581 582
  extends:
    - .meson-build
    - .ci-deqp-artifacts
583
  variables:
584
    UNWIND: "enabled"
585 586
    DRI_LOADERS: >
      -D glx=dri
587 588
      -D gbm=enabled
      -D egl=enabled
589
      -D platforms=x11
590
    GALLIUM_ST: >
591
      -D dri3=enabled
592
    GALLIUM_DRIVERS: "swrast,virgl,radeonsi"
Dave Airlie's avatar
Dave Airlie committed
593
    VULKAN_DRIVERS: "swrast,amd"
594
    BUILDTYPE: "debugoptimized"
595 596
    EXTRA_OPTION: >
      -D werror=true
597 598
    UPLOAD_FOR_LAVA: 1
    DEBIAN_ARCH: amd64
599 600 601 602
  script:
    - .gitlab-ci/meson-build.sh
    - .gitlab-ci/prepare-artifacts.sh

Emma Anholt's avatar
Emma Anholt committed
603 604 605 606 607 608 609 610
meson-testing-asan:
  extends:
    - meson-testing
  variables:
    EXTRA_OPTION: >
      -D b_sanitize=address
    UPLOAD_FOR_LAVA: ""

611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626
meson-clover-testing:
  extends:
    - .meson-build
    - .ci-deqp-artifacts
  variables:
    UNWIND: "enabled"
    LLVM_VERSION: 10
    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"
627 628
    EXTRA_OPTION: >
      -D werror=true
629 630 631 632
  script:
    - .gitlab-ci/meson-build.sh
    - .gitlab-ci/prepare-artifacts.sh

633
meson-gallium:
634
  extends: .meson-build
635
  variables:
636
    UNWIND: "enabled"
637 638
    DRI_LOADERS: >
      -D glx=dri
639 640
      -D gbm=enabled
      -D egl=enabled
641
      -D platforms=x11,wayland
642
    GALLIUM_ST: >
643
      -D dri3=enabled
644
      -D gallium-extra-hud=true
645 646
      -D gallium-vdpau=enabled
      -D gallium-xvmc=enabled
647
      -D gallium-omx=bellagio
648 649
      -D gallium-va=enabled
      -D gallium-xa=enabled
650 651
      -D gallium-nine=true
      -D gallium-opencl=disabled
652
    GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swr,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink"
653
    VULKAN_DRIVERS: swrast
654
    EXTRA_OPTION: >
Emma Anholt's avatar
Emma Anholt committed
655
      -D osmesa=true
656
      -D tools=all
657
      -D werror=true
658 659 660
  script:
    - .gitlab-ci/meson-build.sh
    - .gitlab-ci/run-shader-db.sh
661
    - src/freedreno/.gitlab-ci/run-fdtools.sh
662

663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
# 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
684
    GALLIUM_DRIVERS: "nouveau,kmsro,freedreno,r300,svga,swrast,v3d,vc4,virgl,etnaviv,panfrost,lima,zink"
685 686
    BUILDTYPE: "release"
    EXTRA_OPTION: >
687
      -D osmesa=true
688 689 690 691 692
      -D tools=all
      -D werror=true
  script:
    - .gitlab-ci/meson-build.sh

693
meson-android:
694 695 696
  extends:
    - .meson-cross
    - .use-android_build
697 698 699 700 701 702 703 704 705
  variables:
    UNWIND: "disabled"
    DRI_LOADERS: >
      -D glx=disabled
      -D gbm=disabled
      -D egl=enabled
      -D platforms=android
    EXTRA_OPTION: >
      -D android-stub=true
706
      -D llvm=disabled
707
      -D platform-sdk-version=26
708 709 710 711 712 713 714 715 716
    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
717 718 719 720 721 722 723 724 725
    LLVM_VERSION: ""
  script:
    # arm64 build: Can't build v3d/vc4 because they require expat for v3d_decode.
    - 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 VULKAN_DRIVERS=freedreno .gitlab-ci/meson-build.sh
    # 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.
    # - 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
726

727 728 729
.meson-cross:
  extends:
    - .meson-build
730
  stage: build-misc
731
  variables:
732
    UNWIND: "disabled"
733
    DRI_LOADERS: >
734
      -D glx=dri
Christian Gmeiner's avatar
Christian Gmeiner committed
735
      -D gbm=enabled
736
      -D egl=enabled
737
      -D platforms=x11
Emma Anholt's avatar
Emma Anholt committed
738
      -D osmesa=false
739
    GALLIUM_ST: >
740
      -D dri3=enabled
741 742
      -D gallium-vdpau=disabled
      -D gallium-xvmc=disabled
743
      -D gallium-omx=disabled
744 745
      -D gallium-va=disabled
      -D gallium-xa=disabled
746
      -D gallium-nine=false
747
    LLVM_VERSION: "8"
748

749
.meson-arm:
750 751 752
  extends:
    - .meson-cross
    - .use-arm_build
753 754
  needs:
    - arm_build
755
  variables:
756
    VULKAN_DRIVERS: freedreno,broadcom
757
    GALLIUM_DRIVERS: "etnaviv,freedreno,kmsro,lima,nouveau,panfrost,swrast,tegra,v3d,vc4"
758
    BUILDTYPE: "debugoptimized"
759 760 761 762
  tags:
    - aarch64

meson-armhf:
763 764 765
  extends:
    - .meson-arm
    - .ci-deqp-artifacts
766 767
  variables:
    CROSS: armhf
768
    LLVM_VERSION: "7"
769
    EXTRA_OPTION: >
770
      -D llvm=disabled
771 772
    UPLOAD_FOR_LAVA: 1
    DEBIAN_ARCH: armhf
773 774 775
  script:
    - .gitlab-ci/meson-build.sh
    - .gitlab-ci/prepare-artifacts.sh
776 777

meson-arm64:
778 779 780
  extends:
    - .meson-arm
    - .ci-deqp-artifacts
781
  variables:
782
    VULKAN_DRIVERS: "freedreno,broadcom"
783
    EXTRA_OPTION: >
784
      -D llvm=disabled
785 786
    UPLOAD_FOR_LAVA: 1
    DEBIAN_ARCH: arm64
787 788 789
  script:
    - .gitlab-ci/meson-build.sh
    - .gitlab-ci/prepare-artifacts.sh
790

791 792 793 794 795 796
meson-arm64-build-test:
  extends:
    - .meson-arm
    - .ci-deqp-artifacts
  variables:
    VULKAN_DRIVERS: "amd"
Tomeu Vizoso's avatar
Tomeu Vizoso committed
797 798
    EXTRA_OPTION: >
      -Dtools=panfrost
799
      -D werror=true
800 801 802
  script:
    - .gitlab-ci/meson-build.sh

803 804 805
meson-clang:
  extends: .meson-build
  variables:
806
    UNWIND: "enabled"
807 808
    DRI_LOADERS: >
      -D glvnd=true
809
    DRI_DRIVERS: "auto"
810
    GALLIUM_DRIVERS: "iris,nouveau,kmsro,r300,r600,freedreno,swr,swrast,svga,v3d,vc4,virgl,etnaviv,panfrost,lima,zink,radeonsi,tegra"
811
    VULKAN_DRIVERS: intel,amd,freedreno,broadcom
812 813
    CC: "ccache clang-10"
    CXX: "ccache clang++-10"
814

Daniel Stone's avatar
Daniel Stone committed
815
meson-windows-vs2019:
816 817
  extends:
    - .build-windows
818
    - .use-windows_build_vs2019
819
    - .windows-build-rules
820
  stage: build-misc
821
  script:
822
    - . .\.gitlab-ci\windows\mesa_build.ps1
823 824 825
  artifacts:
    paths:
      - _install/
826

827 828 829 830
test-d3d12-windows:
  extends:
    - .build-windows
    - .use-windows_build_vs2019
831
    - .windows-test-rules
832
  stage: layered-backends
833