The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ci: Respect FDO_CI_CONCURRENT.

Avoid oversubscribing shared runners.

+103 -69
+52 -60
.gitlab-ci.yml
··· 1 1 # SPDX-License-Identifier: CC0-1.0 2 - # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 2 + # SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors 3 3 4 4 ###################################### 5 5 # GENERATED - DO NOT EDIT # ··· 85 85 - .gitlab-ci/**/* 86 86 variables: 87 87 FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates clang-format cmake codespell curl debhelper devscripts doxygen dput-ng gettext-base git glslang-tools graphviz libavcodec-dev libbluetooth-dev libbsd-dev libcjson-dev libdbus-1-dev libegl1-mesa-dev libeigen3-dev libgl1-mesa-dev libglvnd-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libhidapi-dev libopencv-dev libsdl2-dev libsystemd-dev libudev-dev libusb-1.0-0-dev libuvc-dev libv4l-dev libvulkan-dev libwayland-dev libx11-dev libx11-xcb-dev libxcb-randr0-dev libxrandr-dev libxxf86vm-dev ninja-build pandoc patch pkg-config python3 python3-click python3-pip unzip wget' 88 - FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/i386_and_proclamation_container_prep.sh' 88 + FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/i386_and_proclamation_container_prep.sh' 89 89 90 90 # Make Debian bullseye-ndk image 91 91 debian:bullseye-ndk:container_prep: ··· 98 98 - .gitlab-ci/**/* 99 99 variables: 100 100 FDO_DISTRIBUTION_PACKAGES: 'ca-certificates cmake default-jdk-headless git glslang-tools libeigen3-dev meson ninja-build pkg-config python3 unzip wget' 101 - FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/android_container_prep.sh' 101 + FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/android_container_prep.sh' 102 102 103 103 # Make Ubuntu focal image 104 104 ubuntu:focal:container_prep: ··· 135 135 - .gitlab-ci/**/* 136 136 variables: 137 137 FDO_DISTRIBUTION_PACKAGES: 'base-devel bc bluez-libs boost check clang cmake diffutils doxygen eigen ffmpeg fmt gcc git glew glfw-x11 glslang glu graphviz gtest gtk3 hidapi libbsd libusb libxrandr mesa meson ninja opencv patch pipewire-jack pkgconfig python-attrs python-setuptools python3 qt5-base v4l-utils vulkan-headers vulkan-icd-loader wayland wget wireplumber' 138 - FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/install-arch-additional-deps.sh' 138 + FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/install-arch-additional-deps.sh' 139 139 140 140 ### 141 141 # Container usage base jobs ··· 285 285 - popd 286 286 287 287 script: 288 - - rm -rf build 289 - - cmake -GNinja -B build -S . 290 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 291 - - ninja -C build 288 + 289 + - .gitlab-ci/prebuild.sh 290 + - .gitlab-ci/ci-cmake-build.sh 292 291 - cd build && ctest --output-on-failure 293 292 artifacts: 294 293 paths: ··· 299 298 extends: 300 299 - .monado.image.debian:bullseye 301 300 script: 302 - - rm -rf build 303 - - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_HAVE_OPENCV=OFF 304 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 305 - - ninja -C build 301 + 302 + - .gitlab-ci/prebuild.sh 303 + - .gitlab-ci/ci-cmake-build.sh -DBUILD_DOC=OFF -DXRT_HAVE_OPENCV=OFF 306 304 - cd build && ctest --output-on-failure 307 305 308 306 debian:cmake-no-sdl2: ··· 310 308 extends: 311 309 - .monado.image.debian:bullseye 312 310 script: 313 - - rm -rf build 314 - - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_HAVE_SDL2=OFF 315 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 316 - - ninja -C build 311 + 312 + - .gitlab-ci/prebuild.sh 313 + - .gitlab-ci/ci-cmake-build.sh -DBUILD_DOC=OFF -DXRT_HAVE_SDL2=OFF 317 314 - cd build && ctest --output-on-failure 318 315 319 316 debian:cmake-no-service: ··· 321 318 extends: 322 319 - .monado.image.debian:bullseye 323 320 script: 324 - - rm -rf build 325 - - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_FEATURE_SERVICE=OFF 326 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 327 - - ninja -C build 321 + 322 + - .gitlab-ci/prebuild.sh 323 + - .gitlab-ci/ci-cmake-build.sh -DBUILD_DOC=OFF -DXRT_FEATURE_SERVICE=OFF 328 324 - cd build && ctest --output-on-failure 329 325 330 326 debian:cmake:32bit: ··· 332 328 extends: 333 329 - .monado.image.debian:bullseye 334 330 script: 335 - - rm -rf build 336 - - cmake -GNinja -B build -S . -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF 337 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 338 - - ninja -C build 331 + 332 + - .gitlab-ci/prebuild.sh 333 + - .gitlab-ci/ci-cmake-build.sh -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF 339 334 - cd build && ctest --output-on-failure 340 335 341 336 ndk:armeabi-v7a: ··· 343 338 extends: 344 339 - .monado.image.debian:bullseye-ndk 345 340 script: 346 - - rm -rf build 347 - - cmake -GNinja -B build -S . -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=26 -DBUILD_DOC=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3 348 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 349 - - ninja -C build 341 + 342 + - .gitlab-ci/prebuild.sh 343 + - .gitlab-ci/ci-cmake-build.sh -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=26 -DBUILD_DOC=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3 350 344 351 345 ndk:arm64-v8a: 352 346 stage: build 353 347 extends: 354 348 - .monado.image.debian:bullseye-ndk 355 349 script: 356 - - rm -rf build 357 - - cmake -GNinja -B build -S . -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=26 -DBUILD_DOC=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3 358 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 359 - - ninja -C build 350 + 351 + - .gitlab-ci/prebuild.sh 352 + - .gitlab-ci/ci-cmake-build.sh -DANDROID_ABI=arm64-v8a -DANDROID_PLATFORM=26 -DBUILD_DOC=OFF -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ -DEIGEN3_INCLUDE_DIR=/usr/include/eigen3 360 353 361 354 android:outOfProcessDebug: 362 355 stage: build ··· 374 367 - .gradlehome/caches 375 368 376 369 script: 377 - - cp .gitlab-ci/local.properties . 378 - - ./gradlew clean 379 - - ./gradlew assembleOutOfProcessDebug 370 + 371 + - .gitlab-ci/prebuild.sh 372 + - .gitlab-ci/ci-gradle-build.sh assembleOutOfProcessDebug 380 373 artifacts: 381 374 paths: 382 375 - src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess ··· 397 390 - .gradlehome/caches 398 391 399 392 script: 400 - - cp .gitlab-ci/local.properties . 401 - - ./gradlew clean 402 - - ./gradlew assembleInProcessDebug 393 + 394 + - .gitlab-ci/prebuild.sh 395 + - .gitlab-ci/ci-gradle-build.sh assembleInProcessDebug 403 396 artifacts: 404 397 paths: 405 398 - src/xrt/targets/openxr_android/build/outputs/apk/inProcess ··· 420 413 - .gradlehome/caches 421 414 422 415 script: 423 - - cp .gitlab-ci/local.properties . 424 - - ./gradlew clean 425 - - ./gradlew assembleOutOfProcessRelease 416 + 417 + - .gitlab-ci/prebuild.sh 418 + - .gitlab-ci/ci-gradle-build.sh assembleOutOfProcessRelease 426 419 artifacts: 427 420 paths: 428 421 - src/xrt/targets/openxr_android/build/outputs/apk/outOfProcess ··· 443 436 - .gradlehome/caches 444 437 445 438 script: 446 - - cp .gitlab-ci/local.properties . 447 - - ./gradlew clean 448 - - ./gradlew assembleInProcessRelease 439 + 440 + - .gitlab-ci/prebuild.sh 441 + - .gitlab-ci/ci-gradle-build.sh assembleInProcessRelease 449 442 artifacts: 450 443 paths: 451 444 - src/xrt/targets/openxr_android/build/outputs/apk/inProcess ··· 455 448 extends: 456 449 - .monado.image.ubuntu:focal 457 450 script: 458 - - rm -rf build 459 - - cmake -GNinja -B build -S . -DBUILD_DOC=OFF 460 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 461 - - ninja -C build 451 + 452 + - .gitlab-ci/prebuild.sh 453 + - .gitlab-ci/ci-cmake-build.sh -DBUILD_DOC=OFF 462 454 - cd build && ctest --output-on-failure 463 455 464 456 ubuntu:jammy:cmake: ··· 466 458 extends: 467 459 - .monado.image.ubuntu:jammy 468 460 script: 469 - - rm -rf build 470 - - cmake -GNinja -B build -S . -DBUILD_DOC=OFF 471 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 472 - - ninja -C build 461 + 462 + - .gitlab-ci/prebuild.sh 463 + - .gitlab-ci/ci-cmake-build.sh -DBUILD_DOC=OFF 473 464 - cd build && ctest --output-on-failure 474 465 475 466 arch:cmake: ··· 477 468 extends: 478 469 - .monado.image.arch:rolling 479 470 script: 480 - - rm -rf build 481 - - cmake -GNinja -B build -S . 482 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 483 - - ninja -C build 471 + 472 + - .gitlab-ci/prebuild.sh 473 + - .gitlab-ci/ci-cmake-build.sh 484 474 - cd build && ctest --output-on-failure 485 475 486 476 arch:cmake:clang: ··· 488 478 extends: 489 479 - .monado.image.arch:rolling 490 480 script: 491 - - rm -rf build 492 - - cmake -GNinja -B build -S . -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ 493 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 494 - - ninja -C build 481 + 482 + - .gitlab-ci/prebuild.sh 483 + - .gitlab-ci/ci-cmake-build.sh -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ 495 484 - cd build && ctest --output-on-failure 496 485 497 486 # Windows build ··· 534 523 - git config --global user.name Monado CI 535 524 - git config --global user.email ryan.pavlik@collabora.com 536 525 script: 526 + - .gitlab-ci/prebuild.sh 537 527 # Prep the source tree 538 528 - git clean -dfx 539 529 # Call this script to build binary and source packages. ··· 560 550 - git config --global user.name Monado CI 561 551 - git config --global user.email ryan.pavlik@collabora.com 562 552 script: 553 + - .gitlab-ci/prebuild.sh 563 554 # Prep the source tree 564 555 - git clean -dfx 565 556 # Call this script to build binary and source packages. ··· 586 577 - git config --global user.name Monado CI 587 578 - git config --global user.email ryan.pavlik@collabora.com 588 579 script: 580 + - .gitlab-ci/prebuild.sh 589 581 # Prep the source tree 590 582 - git clean -dfx 591 583 # Call this script to build binary and source packages.
+10
.gitlab-ci/ci-cmake-build.sh
··· 1 + #!/usr/bin/env bash 2 + # SPDX-License-Identifier: CC0-1.0 3 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 4 + set -e 5 + set -x 6 + 7 + rm -rf build 8 + cmake -GNinja -B build -S . "$@" 9 + echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 10 + ninja -C build
+13
.gitlab-ci/ci-gradle-build.sh
··· 1 + #!/usr/bin/env bash 2 + # SPDX-License-Identifier: CC0-1.0 3 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 4 + set -e 5 + 6 + MAX_WORKERS="${FDO_CI_CONCURRENT:-4}" 7 + 8 + export GRADLE_ARGS="-Porg.gradle.daemon=false " 9 + 10 + set -x 11 + cp .gitlab-ci/local.properties . 12 + ./gradlew clean 13 + ./gradlew --max-workers "$MAX_WORKERS" "$@"
+6 -9
.gitlab-ci/ci.template
··· 1 1 # SPDX-License-Identifier: CC0-1.0 2 - # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 2 + # SPDX-FileCopyrightText: 2018-2023 Collabora, Ltd. and the Monado contributors 3 3 4 4 {# ignore the warning, this is actually the template to edit. #} 5 5 ###################################### ··· 80 80 {# Needed to be a mapping so it could be "merged" #} 81 81 FDO_DISTRIBUTION_PACKAGES: '{{image.packages | sort | join(" ")}}' 82 82 {% if "script" in image %} 83 - FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/{{image["script"]}}' 83 + FDO_DISTRIBUTION_EXEC: 'env FDO_CI_CONCURRENT=${FDO_CI_CONCURRENT} bash .gitlab-ci/{{image["script"]}}' 84 84 {% endif %} 85 85 {% endfor -%} {%- endfor %} 86 86 ··· 166 166 167 167 script: 168 168 169 + - .gitlab-ci/prebuild.sh 169 170 {#- regular or NDK cmake builds -#} 170 171 {%- if "cmake" in job.name or "ndk" in job.name %} 171 172 172 - - rm -rf build 173 - - cmake -GNinja -B build -S . {{- make_cmake_args(job.cmake_defines) }} 174 - - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 175 - - ninja -C build 173 + - .gitlab-ci/ci-cmake-build.sh {{- make_cmake_args(job.cmake_defines) }} 176 174 177 175 {#- gradle builds -#} 178 176 {%- elif "android" in job.name %} 179 177 180 - - cp .gitlab-ci/local.properties . 181 - - ./gradlew clean 182 - - ./gradlew {{ job.target }} 178 + - .gitlab-ci/ci-gradle-build.sh {{ job.target }} 183 179 184 180 {%- else %} 185 181 ··· 247 243 - git config --global user.name {{packaging.name}} 248 244 - git config --global user.email {{packaging.email}} 249 245 script: 246 + - .gitlab-ci/prebuild.sh 250 247 # Prep the source tree 251 248 - git clean -dfx 252 249 # Call this script to build binary and source packages.
+22
.gitlab-ci/prebuild.sh
··· 1 + #!/bin/sh 2 + # Copyright 2020-2023, Mesa contributors 3 + # Copyright 2020, Collabora, Ltd. 4 + # SPDX-License-Identifier: MIT 5 + 6 + # From https://gitlab.freedesktop.org/mesa/mesa/-/blob/999b956ebc4c26fa0c407369e630c687ece02209/.gitlab-ci/container/container_pre_build.sh 7 + 8 + set -e 9 + 10 + # Make a wrapper script for ninja to always include the -j flags 11 + # to avoid oversubscribing/DOS'ing the shared runners 12 + { 13 + echo '#!/bin/sh -x' 14 + # shellcheck disable=SC2016 15 + echo '/usr/bin/ninja -j${FDO_CI_CONCURRENT:-4} "$@"' 16 + } > /usr/local/bin/ninja 17 + chmod +x /usr/local/bin/ninja 18 + 19 + 20 + # Set MAKEFLAGS so that all make invocations in container builds include the 21 + # flags (doesn't apply to non-container builds, but we don't run make there) 22 + export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"