The open source OpenXR runtime
0
fork

Configure Feed

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

ci: Switch to using ci-fairy templates to simplify, drop buster support.

The CI is now mostly data driven and should be much easier to handle.

+1009 -381
+319 -309
.gitlab-ci.yml
··· 1 1 # SPDX-License-Identifier: CC0-1.0 2 - # SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors 2 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 3 + 4 + ###################################### 5 + # GENERATED - DO NOT EDIT # 6 + # see .gitlab-ci/ci.template instead # 7 + ###################################### 3 8 4 9 variables: 5 10 FDO_UPSTREAM_REPO: monado/monado 6 11 7 - .templates_sha: &templates_sha 14731f78c23c7b523a85a26a068ade9ac1ecd2f3 8 - 9 - # Variables listing packages for Debian-based distros 10 - .monado.variables.debian-based-packages: 11 - variables: 12 - # Packages required for build and some other basic jobs 13 - CORE_REQUIRED_PACKAGES: "build-essential git wget unzip cmake meson ninja-build libeigen3-dev curl patch python3 pkg-config libx11-dev libx11-xcb-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libvulkan-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libudev-dev" 14 - 15 - # These are optional packages, that we're building against to ensure we build as much code as possible 16 - FEATURE_PACKAGES: "libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev libdbus-1-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libsystemd-dev libbsd-dev" 17 - 18 - # Only used for building packages 19 - PACKAGING_PACKAGES: "devscripts debhelper dput-ng gettext-base pandoc" 12 + .templates_sha: &templates_sha 34039cd573a2df832d465bc9e4c5f543571f5241 20 13 21 - # Used for ancillary "not compilation" jobs/features, like docs, changelogs, formatting, etc. 22 - TOOLS_REQUIRED_PACKAGES: "codespell doxygen graphviz python3-pip python3-click" 14 + include: 15 + # Debian 16 + - project: "freedesktop/ci-templates" 17 + ref: *templates_sha 18 + file: "/templates/debian.yml" 19 + # Ubuntu 20 + - project: "freedesktop/ci-templates" 21 + ref: *templates_sha 22 + file: "/templates/ubuntu.yml" 23 + # Arch 24 + - project: "freedesktop/ci-templates" 25 + ref: *templates_sha 26 + file: "/templates/arch.yml" 23 27 24 - # The NDK builder uses only these packages 25 - NDK_PACKAGES: "git wget unzip cmake meson ninja-build libeigen3-dev python3 pkg-config ca-certificates glslang-tools" 26 28 27 - # Variables for build and usage of Debian 10 (Buster) image 28 - .monado.variables.debian:buster: 29 + # Variables for build and usage of Debian bullseye image 30 + .monado.variables.debian:bullseye: 29 31 variables: 30 - FDO_DISTRIBUTION_VERSION: buster 31 - FDO_DISTRIBUTION_TAG: "2021-10-28.0" 32 + FDO_DISTRIBUTION_VERSION: "bullseye" 33 + FDO_DISTRIBUTION_TAG: "2022-01-19.0" 32 34 33 - # Variables for build and usage of Debian 11 (Bullseye) image 34 - .monado.variables.debian:bullseye: 35 + # Variables for build and usage of Debian bullseye-ndk image 36 + .monado.variables.debian:bullseye-ndk: 35 37 variables: 36 - FDO_DISTRIBUTION_VERSION: bullseye 37 - FDO_DISTRIBUTION_TAG: "2021-11-04.0" 38 + FDO_DISTRIBUTION_VERSION: "bullseye" 39 + FDO_DISTRIBUTION_TAG: "2022-01-19.0" 40 + FDO_REPO_SUFFIX: ndk 38 41 39 - # Variables for build and usage of Ubuntu 20.04 LTS (Focal) image 42 + # Variables for build and usage of Ubuntu focal image 40 43 .monado.variables.ubuntu:focal: 41 44 variables: 42 45 FDO_DISTRIBUTION_VERSION: "20.04" 43 46 FDO_DISTRIBUTION_TAG: "2021-10-27.1" 44 47 45 - # Variables for build and usage of Ubuntu 21.04 (Hirsute) image 48 + # Variables for build and usage of Ubuntu hirsute image 46 49 .monado.variables.ubuntu:hirsute: 47 50 variables: 48 51 FDO_DISTRIBUTION_VERSION: "21.04" 49 52 FDO_DISTRIBUTION_TAG: "2021-10-27.1" 50 53 51 - # Variables for build and usage of Ubuntu 21.10 (Impish) image 54 + # Variables for build and usage of Ubuntu impish image 52 55 .monado.variables.ubuntu:impish: 53 56 variables: 54 57 FDO_DISTRIBUTION_VERSION: "21.10" 55 58 FDO_DISTRIBUTION_TAG: "2021-10-28.0" 56 59 57 - # Variables for build and usage of Debian 10 (Buster) + Android NDK image 58 - .monado.variables.debian:buster-ndk: 59 - variables: 60 - FDO_DISTRIBUTION_VERSION: buster 61 - FDO_DISTRIBUTION_TAG: "2020-05-06.0" 62 - FDO_REPO_SUFFIX: ndk 63 - 64 - # Variables for build and usage of Arch Linux image 60 + # Variables for build and usage of Arch rolling image 65 61 .monado.variables.arch:rolling: 66 62 variables: 63 + FDO_DISTRIBUTION_VERSION: "rolling" 67 64 FDO_DISTRIBUTION_TAG: "2021-09-14.0" 68 65 69 - include: 70 - - project: "freedesktop/ci-templates" 71 - ref: *templates_sha 72 - file: "/templates/debian.yml" 73 - - project: "freedesktop/ci-templates" 74 - ref: *templates_sha 75 - file: "/templates/ubuntu.yml" 76 - - project: "freedesktop/ci-templates" 77 - ref: *templates_sha 78 - file: "/templates/arch.yml" 79 - 80 66 stages: 81 67 - container_prep 82 68 - build ··· 87 73 88 74 ### 89 75 # Container prep jobs 90 - 91 - # Base for all container prep 92 - .monado.variables.container-prep-base: 93 - # "stage" set here doesn't work, for some reason 94 - variables: 95 - # no need to pull the whole tree for rebuilding the image - is this still needed? 96 - GIT_STRATEGY: none 97 - # Each most-derived container prep job has a script to set up stuff for it. 98 - FDO_DISTRIBUTION_EXEC: "bash .gitlab-ci/$(echo ${CI_JOB_NAME} | sed 's/:/_/g').sh" 99 - 100 - # Debian Buster (x64 + i386) 101 - debian:buster:container_prep: 102 - stage: container_prep 103 - extends: 104 - - .monado.variables.debian:buster 105 - - .monado.variables.container-prep-base 106 - - .monado.variables.debian-based-packages 107 - - .fdo.container-build@debian # from ci-templates 108 - variables: 109 - # a list of packages to install - assembled from .monado.variables.debian-based-packages, plus clang-format-7 (which we don't actually need anymore) 110 - FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES} clang-format-7" 111 - 112 - # Debian Bullseye (x64 + i386) 76 + # Make Debian bullseye image 113 77 debian:bullseye:container_prep: 114 78 stage: container_prep 115 79 extends: 116 80 - .monado.variables.debian:bullseye 117 - - .monado.variables.container-prep-base 118 - - .monado.variables.debian-based-packages 119 81 - .fdo.container-build@debian # from ci-templates 120 82 variables: 121 - # a list of packages to install - assembled from .monado.variables.debian-based-packages, plus clang-format. 122 - FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES} clang-format" 83 + 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 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 meson ninja-build pandoc patch pkg-config python3 python3-click python3-pip unzip wget' 84 + FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/i386_and_proclamation_container_prep.sh' 123 85 124 - # Arch Linux (x64) 125 - arch:container_prep: 86 + # Make Debian bullseye-ndk image 87 + debian:bullseye-ndk:container_prep: 126 88 stage: container_prep 127 89 extends: 128 - - .monado.variables.arch:rolling 129 - - .monado.variables.container-prep-base 130 - - .fdo.container-build@arch # from ci-templates 90 + - .monado.variables.debian:bullseye-ndk 91 + - .fdo.container-build@debian # from ci-templates 131 92 variables: 132 - # a list of packages to install 133 - FDO_DISTRIBUTION_PACKAGES: "git gcc clang cmake meson ninja pkgconfig python3 diffutils patch doxygen graphviz eigen hidapi libxrandr mesa glslang vulkan-headers vulkan-icd-loader check glfw-x11 libusb opencv gtk3 ffmpeg v4l-utils qt5-base" 93 + FDO_DISTRIBUTION_PACKAGES: 'ca-certificates cmake git glslang-tools libeigen3-dev meson ninja-build pkg-config python3 unzip wget' 94 + FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/ndk_container_prep.sh' 134 95 135 - # Ubuntu Focal (x64) 96 + # Make Ubuntu focal image 136 97 ubuntu:focal:container_prep: 137 98 stage: container_prep 138 99 extends: 139 100 - .monado.variables.ubuntu:focal 140 - - .monado.variables.container-prep-base 141 - - .monado.variables.debian-based-packages 142 101 - .fdo.container-build@ubuntu # from ci-templates 143 102 variables: 144 - # a list of packages to install - assembled from .monado.variables.debian-based-packages 145 - FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES}" 103 + FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates cmake curl debhelper devscripts dput-ng gettext-base git glslang-tools libavcodec-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 meson ninja-build pandoc patch pkg-config python3 unzip wget' 146 104 147 - # Ubuntu Hirsute (x64) 105 + # Make Ubuntu hirsute image 148 106 ubuntu:hirsute:container_prep: 149 107 stage: container_prep 150 108 extends: 151 109 - .monado.variables.ubuntu:hirsute 152 - - .monado.variables.container-prep-base 153 - - .monado.variables.debian-based-packages 154 110 - .fdo.container-build@ubuntu # from ci-templates 155 111 variables: 156 - # a list of packages to install - assembled from .monado.variables.debian-based-packages 157 - FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES}" 112 + FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates cmake curl debhelper devscripts dput-ng gettext-base git glslang-tools libavcodec-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 meson ninja-build pandoc patch pkg-config python3 unzip wget' 158 113 159 - # Ubuntu Impish (x64) 114 + # Make Ubuntu impish image 160 115 ubuntu:impish:container_prep: 161 116 stage: container_prep 162 117 extends: 163 118 - .monado.variables.ubuntu:impish 164 - - .monado.variables.container-prep-base 165 - - .monado.variables.debian-based-packages 166 119 - .fdo.container-build@ubuntu # from ci-templates 167 120 variables: 168 - # a list of packages to install - assembled from .monado.variables.debian-based-packages, plus reprepro 169 - FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} reprepro" 121 + FDO_DISTRIBUTION_PACKAGES: 'build-essential ca-certificates cmake curl debhelper devscripts dput-ng gettext-base git glslang-tools libavcodec-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 meson ninja-build pandoc patch pkg-config python3 reprepro unzip wget' 170 122 171 - # Debian Buster + the Android NDK in /opt/android-ndk 172 - # The NDK itself gets installed by .gitlab-ci/ndk:container_prep.sh 173 - ndk:container_prep: 123 + # Make Arch rolling image 124 + arch:rolling:container_prep: 174 125 stage: container_prep 175 126 extends: 176 - - .monado.variables.debian:buster-ndk 177 - - .monado.variables.container-prep-base 178 - - .fdo.container-build@debian # from ci-templates 127 + - .monado.variables.arch:rolling 128 + - .fdo.container-build@arch # from ci-templates 179 129 variables: 180 - # Repo suffix is set in .monado.variables.debian:buster-ndk 181 - # a list of packages to install 182 - FDO_DISTRIBUTION_PACKAGES: "${NDK_PACKAGES}" 130 + FDO_DISTRIBUTION_PACKAGES: 'check clang cmake diffutils doxygen eigen ffmpeg gcc git glfw-x11 glslang graphviz gtk3 hidapi libusb libxrandr mesa meson ninja opencv patch pkgconfig python3 qt5-base v4l-utils vulkan-headers vulkan-icd-loader' 131 + 132 + ### 133 + # Container usage base jobs 134 + 135 + # Base for using Debian bullseye image 136 + .monado.image.debian:bullseye: 137 + extends: 138 + - .monado.variables.debian:bullseye 139 + - .fdo.distribution-image@debian # from ci-templates 140 + 141 + 142 + # Base for using Debian bullseye-ndk image 143 + .monado.image.debian:bullseye-ndk: 144 + extends: 145 + - .monado.variables.debian:bullseye-ndk 146 + - .fdo.suffixed-image@debian # from ci-templates 147 + 148 + 149 + # Base for using Ubuntu focal image 150 + .monado.image.ubuntu:focal: 151 + extends: 152 + - .monado.variables.ubuntu:focal 153 + - .fdo.distribution-image@ubuntu # from ci-templates 154 + 155 + 156 + # Base for using Ubuntu hirsute image 157 + .monado.image.ubuntu:hirsute: 158 + extends: 159 + - .monado.variables.ubuntu:hirsute 160 + - .fdo.distribution-image@ubuntu # from ci-templates 161 + 162 + 163 + # Base for using Ubuntu impish image 164 + .monado.image.ubuntu:impish: 165 + extends: 166 + - .monado.variables.ubuntu:impish 167 + - .fdo.distribution-image@ubuntu # from ci-templates 168 + 169 + 170 + # Base for using Arch rolling image 171 + .monado.image.arch:rolling: 172 + extends: 173 + - .monado.variables.arch:rolling 174 + - .fdo.distribution-image@arch # from ci-templates 175 + 183 176 184 177 # Style check job 185 178 format-and-spellcheck: 186 179 extends: 187 - - .monado.variables.debian:bullseye 188 - - .fdo.distribution-image@debian # from ci-templates 180 + - .monado.image.debian:bullseye 181 + 189 182 stage: build 190 183 script: 191 184 - scripts/format-and-spellcheck.sh ··· 204 197 script: 205 198 - reuse lint 206 199 207 - # "Base" job for a CMake build 208 - .monado.base-job.build-cmake: 209 - stage: build 210 - script: 211 - - rm -rf build 212 - - mkdir build 213 - - pushd build 214 - - cmake -GNinja .. $CMAKE_ARGS 215 - # List build options 216 - - grep "^XRT_" CMakeCache.txt 217 - - ninja 218 - - ctest --output-on-failure 219 200 220 - # "Base" job for a Meson build 221 - .monado.base-job.build-meson: 201 + debian:cmake: 222 202 stage: build 223 - script: 224 - - rm -rf build 225 - - mkdir build 226 - - pushd build 227 - - meson .. $MESON_ARGS 228 - - ninja 203 + extends: 204 + - .monado.image.debian:bullseye 229 205 230 - debian:bullseye:cmake: 231 - extends: 232 - - .monado.variables.debian:bullseye 233 - - .fdo.distribution-image@debian # from ci-templates 234 - - .monado.base-job.build-cmake 235 206 before_script: 236 - # Generate "changes since last release" and add to changelog, 237 - # since this is the build that makes our docs. 238 207 - pushd doc/changes 239 208 - proclamation build --overwrite vNEXT 240 209 - popd 210 + script: 211 + - rm -rf build 212 + - cmake -GNinja -B build -S . 213 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 214 + - ninja -C build 215 + - cd build && ctest --output-on-failure 241 216 artifacts: 242 217 paths: 243 218 - build/doc/html/ 244 219 245 220 debian:cmake-no-opencv: 221 + stage: build 246 222 extends: 247 - - .monado.variables.debian:buster 248 - - .fdo.distribution-image@debian # from ci-templates 249 - - .monado.base-job.build-cmake 250 - variables: 251 - CMAKE_ARGS: -DXRT_HAVE_OPENCV=OFF 223 + - .monado.image.debian:bullseye 252 224 253 - debian:cmake-no-opengl: 254 - extends: 255 - - .monado.variables.debian:buster 256 - - .fdo.distribution-image@debian # from ci-templates 257 - - .monado.base-job.build-cmake 258 - variables: 259 - CMAKE_ARGS: -DXRT_HAVE_OPENGL=OFF 225 + script: 226 + - rm -rf build 227 + - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_HAVE_OPENCV=OFF 228 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 229 + - ninja -C build 230 + - cd build && ctest --output-on-failure 260 231 261 232 debian:cmake-no-sdl2: 233 + stage: build 262 234 extends: 263 - - .monado.variables.debian:buster 264 - - .fdo.distribution-image@debian # from ci-templates 265 - - .monado.base-job.build-cmake 266 - variables: 267 - CMAKE_ARGS: -DXRT_HAVE_SDL2=OFF 235 + - .monado.image.debian:bullseye 236 + 237 + script: 238 + - rm -rf build 239 + - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_HAVE_SDL2=OFF 240 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 241 + - ninja -C build 242 + - cd build && ctest --output-on-failure 268 243 269 244 debian:cmake-no-service: 245 + stage: build 270 246 extends: 271 - - .monado.variables.debian:buster 272 - - .fdo.distribution-image@debian # from ci-templates 273 - - .monado.base-job.build-cmake 274 - variables: 275 - CMAKE_ARGS: -DXRT_FEATURE_SERVICE=OFF 247 + - .monado.image.debian:bullseye 276 248 277 - arch:cmake: 249 + script: 250 + - rm -rf build 251 + - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_FEATURE_SERVICE=OFF 252 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 253 + - ninja -C build 254 + - cd build && ctest --output-on-failure 255 + 256 + debian:cmake:32bit: 257 + stage: build 278 258 extends: 279 - - .monado.variables.arch:rolling 280 - - .fdo.distribution-image@arch # from ci-templates 281 - - .monado.base-job.build-cmake 259 + - .monado.image.debian:bullseye 260 + 261 + script: 262 + - rm -rf build 263 + - cmake -GNinja -B build -S . -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF 264 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 265 + - ninja -C build 266 + - cd build && ctest --output-on-failure 282 267 283 - arch:cmake:clang: 268 + debian:meson: 269 + stage: build 284 270 extends: 285 - - .monado.variables.arch:rolling 286 - - .fdo.distribution-image@arch # from ci-templates 287 - - .monado.base-job.build-cmake 288 - variables: 289 - CMAKE_ARGS: -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ 271 + - .monado.image.debian:bullseye 272 + 273 + script: 274 + - rm -rf build 275 + - meson setup build . 276 + - ninja -C build 277 + 278 + debian:meson:32bit: 279 + stage: build 280 + extends: 281 + - .monado.image.debian:bullseye 282 + 283 + script: 284 + - rm -rf build 285 + - meson setup build . --prefix=/usr --libdir=/usr/lib/i386-linux-gnu --cross-file=.gitlab-ci/i386-cross.txt 286 + - ninja -C build 287 + 288 + ndk:armeabi-v7a: 289 + stage: build 290 + extends: 291 + - .monado.image.debian:bullseye-ndk 292 + 293 + script: 294 + - rm -rf build 295 + - 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 296 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 297 + - ninja -C build 298 + 299 + ndk:arm64-v8a: 300 + stage: build 301 + extends: 302 + - .monado.image.debian:bullseye-ndk 303 + 304 + script: 305 + - rm -rf build 306 + - 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 307 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 308 + - ninja -C build 290 309 291 310 ubuntu:cmake: 311 + stage: build 292 312 extends: 293 - - .monado.variables.ubuntu:focal 294 - - .fdo.distribution-image@ubuntu # from ci-templates 295 - - .monado.base-job.build-cmake 313 + - .monado.image.ubuntu:focal 296 314 297 - debian:meson: 298 - extends: 299 - - .monado.variables.debian:buster 300 - - .fdo.distribution-image@debian # from ci-templates 301 - - .monado.base-job.build-meson 315 + script: 316 + - rm -rf build 317 + - cmake -GNinja -B build -S . -DBUILD_DOC=OFF 318 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 319 + - ninja -C build 320 + - cd build && ctest --output-on-failure 302 321 303 322 ubuntu:meson: 323 + stage: build 304 324 extends: 305 - - .monado.variables.ubuntu:focal 306 - - .fdo.distribution-image@ubuntu # from ci-templates 307 - - .monado.base-job.build-meson 325 + - .monado.image.ubuntu:focal 326 + 327 + script: 328 + - rm -rf build 329 + - meson setup build . 330 + - ninja -C build 308 331 309 - arch:meson: 332 + ubuntu:latest:cmake: 333 + stage: build 310 334 extends: 311 - - .monado.variables.arch:rolling 312 - - .fdo.distribution-image@arch # from ci-templates 313 - - .monado.base-job.build-meson 314 - variables: 315 - MESON_ARGS: -Ddocs=disabled 335 + - .monado.image.ubuntu:impish 336 + 337 + script: 338 + - rm -rf build 339 + - cmake -GNinja -B build -S . -DBUILD_DOC=OFF 340 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 341 + - ninja -C build 342 + - cd build && ctest --output-on-failure 316 343 317 - # Cross-compiling 318 - debian:meson:32bit: 344 + arch:cmake: 345 + stage: build 319 346 extends: 320 - - .monado.variables.debian:buster 321 - - .fdo.distribution-image@debian # from ci-templates 322 - - .monado.base-job.build-meson 323 - variables: 324 - MESON_ARGS: --prefix /usr --libdir /usr/lib/i386-linux-gnu --cross-file ../.gitlab-ci/i386-cross.txt 347 + - .monado.image.arch:rolling 325 348 326 - debian:cmake:32bit: 327 - extends: 328 - - .monado.variables.debian:buster 329 - - .fdo.distribution-image@debian # from ci-templates 330 - - .monado.base-job.build-cmake 331 - variables: 332 - # OpenCV and local OpenHMD doesn't play nicely with us in multi-arch. 333 - CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=off -DXRT_BUILD_DRIVER_OHMD=off 349 + script: 350 + - rm -rf build 351 + - cmake -GNinja -B build -S . 352 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 353 + - ninja -C build 354 + - cd build && ctest --output-on-failure 334 355 335 - # Base of Android NDK builds. 336 - # Takes the last :-delimited part of the name as the ABI to build for, 337 - # so you don't need to do anything other than "extends" in the job 338 - .monado.ndk:build-base: 356 + arch:cmake:clang: 339 357 stage: build 340 358 extends: 341 - - .monado.variables.debian:buster-ndk 342 - - .fdo.suffixed-image@debian # from ci-templates 343 - variables: 344 - ANDROID_PLATFORM: 26 359 + - .monado.image.arch:rolling 360 + 345 361 script: 346 - - mkdir build 347 - - pushd build 348 - # This extracts the ABI from the job name 349 - - export ABI=$(echo $CI_JOB_NAME | cut --delimiter=":" -f 2) 350 - # Note we are pointing CMake to the host install of Eigen3 because it's header-only 351 - # and thus this is safe to do. 352 - - cmake -GNinja .. -DANDROID_PLATFORM=$ANDROID_PLATFORM -DANDROID_ABI=$ABI -DCMAKE_TOOLCHAIN_FILE=/opt/android-ndk/build/cmake/android.toolchain.cmake -DEigen3_DIR=/usr/lib/cmake/eigen3/ 353 - - grep "^XRT_" CMakeCache.txt 354 - - ninja 362 + - rm -rf build 363 + - cmake -GNinja -B build -S . -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ 364 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 365 + - ninja -C build 366 + - cd build && ctest --output-on-failure 355 367 356 - ndk:armeabi-v7a: 357 - extends: .monado.ndk:build-base 368 + arch:meson: 369 + stage: build 370 + extends: 371 + - .monado.image.arch:rolling 358 372 359 - ndk:arm64-v8a: 360 - extends: .monado.ndk:build-base 373 + script: 374 + - rm -rf build 375 + - meson setup build . 376 + - ninja -C build 361 377 362 378 # Packaging 363 379 .monado.packaging.conditions: ··· 368 384 # Otherwise, don't build packages. 369 385 - when: never 370 386 371 - .monado.base-job.debuild: 387 + 388 + 389 + debian:bullseye:package: 372 390 extends: 391 + - .monado.image.debian:bullseye 373 392 - .monado.packaging.conditions 393 + variables: 394 + DEBFULLNAME: "Monado CI" 395 + DEBEMAIL: "ryan.pavlik@collabora.com" 396 + DISTRO: debian 397 + CODENAME: bullseye 398 + DEB_VERSION_SUFFIX: bpo11 374 399 stage: package 375 400 before_script: 376 - # Configure git - needed despite not actually committing here. 377 - - git config --global user.email "ryan.pavlik@collabora.com" 378 - - git config --global user.name "Monado CI" 401 + - git config --global user.name Monado CI 402 + - git config --global user.email ryan.pavlik@collabora.com 379 403 script: 380 404 # Prep the source tree 381 405 - git clean -dfx 382 - - git merge origin/${PACKAGE_BRANCH} --no-commit 383 - - DEBFULLNAME="Monado CI" DEBEMAIL="ryan.pavlik@collabora.com" debian/extra/prepare-commit-package.sh ${CI_COMMIT_SHA} 1~${BACKPORT_SUFFIX}~ci$(date --utc "+%Y%m%d") 384 - # Build the package 385 - - debuild -uc -us 386 - # Use dput-ng to move the package-related files into some artifacts. 387 - - export INCOMING=$(pwd)/incoming 388 - - mkdir -p $INCOMING 389 - - mkdir -p ~/.dput.d/profiles 390 - - cat .gitlab-ci/localhost.json | envsubst > ~/.dput.d/profiles/localhost.json 391 - - dpkg-parsechangelog --show-field version > incoming/${DISTRO}.distro 392 - - dput --debug localhost ../monado_$(dpkg-parsechangelog --show-field version)_amd64.changes 406 + # Call this script to build binary and source packages. 407 + # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints. 408 + - .gitlab-ci/build-and-submit-package.sh 393 409 artifacts: 394 410 paths: 395 411 - "incoming/" 396 412 expire_in: 2 days 397 413 398 - debian:buster:package: 399 - extends: 400 - - .monado.variables.debian:buster 401 - - .fdo.distribution-image@debian # from ci-templates 402 - - .monado.base-job.debuild 403 - variables: 404 - BACKPORT_SUFFIX: bpo10 405 - PACKAGE_BRANCH: debian/buster-backports 406 - DISTRO: buster 407 - 408 - debian:bullseye:package: 409 - extends: 410 - - .monado.variables.debian:bullseye 411 - - .fdo.distribution-image@debian # from ci-templates 412 - - .monado.base-job.debuild 413 - variables: 414 - BACKPORT_SUFFIX: bpo11 415 - PACKAGE_BRANCH: debian/bullseye 416 - DISTRO: bullseye 417 - 418 414 ubuntu:focal:package: 419 415 extends: 420 - - .monado.variables.ubuntu:focal 421 - - .fdo.distribution-image@ubuntu # from ci-templates 422 - - .monado.base-job.debuild 416 + - .monado.image.ubuntu:focal 417 + - .monado.packaging.conditions 423 418 variables: 424 - BACKPORT_SUFFIX: ubuntu2004 425 - PACKAGE_BRANCH: ubuntu/focal 426 - DISTRO: focal 419 + DEBFULLNAME: "Monado CI" 420 + DEBEMAIL: "ryan.pavlik@collabora.com" 421 + DISTRO: ubuntu 422 + CODENAME: focal 423 + DEB_VERSION_SUFFIX: ubuntu2004 424 + stage: package 425 + before_script: 426 + - git config --global user.name Monado CI 427 + - git config --global user.email ryan.pavlik@collabora.com 428 + script: 429 + # Prep the source tree 430 + - git clean -dfx 431 + # Call this script to build binary and source packages. 432 + # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints. 433 + - .gitlab-ci/build-and-submit-package.sh 434 + artifacts: 435 + paths: 436 + - "incoming/" 437 + expire_in: 2 days 427 438 428 439 ubuntu:hirsute:package: 429 440 extends: 430 - - .monado.variables.ubuntu:hirsute 431 - - .fdo.distribution-image@ubuntu # from ci-templates 432 - - .monado.base-job.debuild 433 - 441 + - .monado.image.ubuntu:hirsute 442 + - .monado.packaging.conditions 434 443 variables: 435 - BACKPORT_SUFFIX: ubuntu2104 436 - PACKAGE_BRANCH: ubuntu/hirsute 437 - DISTRO: hirsute 444 + DEBFULLNAME: "Monado CI" 445 + DEBEMAIL: "ryan.pavlik@collabora.com" 446 + DISTRO: ubuntu 447 + CODENAME: hirsute 448 + DEB_VERSION_SUFFIX: ubuntu2104 449 + stage: package 450 + before_script: 451 + - git config --global user.name Monado CI 452 + - git config --global user.email ryan.pavlik@collabora.com 453 + script: 454 + # Prep the source tree 455 + - git clean -dfx 456 + # Call this script to build binary and source packages. 457 + # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints. 458 + - .gitlab-ci/build-and-submit-package.sh 459 + artifacts: 460 + paths: 461 + - "incoming/" 462 + expire_in: 2 days 438 463 439 464 ubuntu:impish:package: 440 465 extends: 441 - - .monado.variables.ubuntu:impish 442 - - .fdo.distribution-image@ubuntu # from ci-templates 443 - - .monado.base-job.debuild 444 - 466 + - .monado.image.ubuntu:impish 467 + - .monado.packaging.conditions 445 468 variables: 446 - BACKPORT_SUFFIX: ubuntu2110 447 - PACKAGE_BRANCH: ubuntu/impish 448 - DISTRO: impish 469 + DEBFULLNAME: "Monado CI" 470 + DEBEMAIL: "ryan.pavlik@collabora.com" 471 + DISTRO: ubuntu 472 + CODENAME: impish 473 + DEB_VERSION_SUFFIX: ubuntu2110 474 + stage: package 475 + before_script: 476 + - git config --global user.name Monado CI 477 + - git config --global user.email ryan.pavlik@collabora.com 478 + script: 479 + # Prep the source tree 480 + - git clean -dfx 481 + # Call this script to build binary and source packages. 482 + # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints. 483 + - .gitlab-ci/build-and-submit-package.sh 484 + artifacts: 485 + paths: 486 + - "incoming/" 487 + expire_in: 2 days 449 488 450 489 reprepro:package: 451 490 stage: reprepro 452 491 extends: 453 - - .monado.variables.ubuntu:impish 492 + - .monado.image.ubuntu:impish 493 + 454 494 - .monado.packaging.conditions 455 - - .fdo.distribution-image@ubuntu # from ci-templates 456 495 dependencies: 457 - - debian:buster:package 458 496 - debian:bullseye:package 459 497 - ubuntu:focal:package 460 498 - ubuntu:hirsute:package 461 499 - ubuntu:impish:package 462 - before_script: 463 - # Convince gnupg to work properly in CI 464 - - mkdir -p ~/.gnupg && chmod 700 ~/.gnupg 465 - - touch ~/.gnupg/gpg.conf 466 - - echo 'use-agent' > ~/.gnupg/gpg.conf 467 - - echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf 468 - - touch ~/.gnupg/gpg-agent.conf 469 - - echo 'allow-loopback-pinentry' > ~/.gnupg/gpg-agent.conf 470 - - echo RELOADAGENT | gpg-connect-agent 471 - - gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE} --import ${MONADO_GPG_SECRET_KEY} 472 - 473 500 script: 474 - # Use reprepro to create an apt repository in our artifacts 475 - - mkdir -p repo/conf 476 - # For each distro, sign the changes file and add it to the repo. 477 - - | 478 - for fn in incoming/*.distro; do 479 - # parse the distro name out 480 - export DISTRO=$(echo $fn | sed -e 's:incoming/::' -e 's:[.]distro::') 481 - echo "Processing $DISTRO" 482 - # add distro to repository config - blank line is mandatory! 483 - cat .gitlab-ci/distributions | envsubst >> repo/conf/distributions 484 - echo >> repo/conf/distributions 485 - 486 - echo "Signing package for $DISTRO" 487 - debsign -k ${MONADO_GPG_FINGERPRINT} -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" incoming/monado_$(cat $fn)_amd64.changes 488 - 489 - echo "Adding package for $DISTRO to the repository" 490 - reprepro -V --ignore=wrongdistribution -b repo include ${DISTRO} incoming/monado_$(cat $fn)_amd64.changes 491 - done 501 + - bash .gitlab-ci/reprepro.sh 492 502 artifacts: 493 503 paths: 494 504 - "repo/" ··· 502 512 only: 503 513 - main 504 514 dependencies: 505 - - debian:bullseye:cmake 515 + - debian:cmake 506 516 - reprepro:package 507 517 script: 508 518 - mkdir -p public ··· 510 520 - mv repo public/apt 511 521 artifacts: 512 522 paths: 513 - - public 523 + - public
-8
.gitlab-ci/arch_container_prep.sh
··· 1 - #!/bin/sh 2 - # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 - # SPDX-License-Identifier: BSL-1.0 4 - 5 - ( 6 - cd $(dirname $0) 7 - bash ./build-openxr-openhmd.sh 8 - )
+21
.gitlab-ci/build-and-submit-package.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 + 5 + set -euo pipefail 6 + 7 + # Prep the source tree 8 + git merge "origin/${DISTRO}/${CODENAME}" --no-commit 9 + datestamp=$(date --utc "+%Y%m%d") 10 + debian/extra/prepare-commit-package.sh "${CI_COMMIT_SHA}" "1~${DEB_VERSION_SUFFIX}~ci${datestamp}" 11 + # Build the package 12 + debuild -uc -us "$@" 13 + # Stash the package version in a convenient file for a later job. 14 + INCOMING="$(pwd)/incoming" 15 + export INCOMING 16 + mkdir -p "$INCOMING" 17 + dpkg-parsechangelog --show-field version > "incoming/${CODENAME}.distro" 18 + # Use dput-ng to move the package-related files into some artifacts. 19 + mkdir -p ~/.dput.d/profiles 20 + envsubst < .gitlab-ci/localhost.json > ~/.dput.d/profiles/localhost.json 21 + dput --debug localhost "../monado_$(dpkg-parsechangelog --show-field version)_amd64.changes"
-22
.gitlab-ci/build-openxr-openhmd.sh
··· 1 - #!/bin/sh 2 - # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 - # SPDX-License-Identifier: BSL-1.0 4 - 5 - # Install the OpenXR SDK, whatever version, installed system-wide. 6 - git clone https://github.com/KhronosGroup/OpenXR-SDK 7 - pushd OpenXR-SDK 8 - mkdir build 9 - pushd build 10 - cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_INSTALL_LIBDIR=lib -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=Off -DPRESENTATION_BACKEND=xlib -DDYNAMIC_LOADER=ON -DOpenGL_GL_PREFERENCE=GLVND -GNinja .. 11 - ninja install 12 - popd 13 - popd 14 - 15 - # Install OpenHMD from git master, as released versions are not sufficient 16 - # for us to build. 17 - git clone https://github.com/OpenHMD/OpenHMD 18 - pushd OpenHMD 19 - mkdir build 20 - meson --prefix=/usr/local --libdir=lib build 21 - ninja -C build install 22 - popd
+26
.gitlab-ci/ci-scripts.mk
··· 1 + # SPDX-License-Identifier: CC0-1.0 2 + # SPDX-FileCopyrightText: 2022 Collabora, Ltd. and the Monado contributors 3 + # 4 + # To generate all the templated files, run this from the root of the repo: 5 + # make -f .gitlab-ci/ci-scripts.mk 6 + 7 + # These also all have their template named the same with a .template suffix. 8 + FILES_IN_SUBDIR := \ 9 + .gitlab-ci/distributions \ 10 + .gitlab-ci/reprepro.sh \ 11 + 12 + CONFIG_FILE := .gitlab-ci/config.yml 13 + all: .gitlab-ci.yml $(FILES_IN_SUBDIR) 14 + .PHONY: all 15 + 16 + clean: 17 + rm -f .gitlab-ci.yml $(FILES_IN_SUBDIR) 18 + .PHONY: clean 19 + 20 + # As the default thing for ci-fairy to template, this is special cased 21 + .gitlab-ci.yml: .gitlab-ci/ci.template $(CONFIG_FILE) 22 + ci-fairy generate-template 23 + 24 + # Everything else is structured alike 25 + $(FILES_IN_SUBDIR): %: %.jinja $(CONFIG_FILE) 26 + ci-fairy generate-template --config=$(CONFIG_FILE) $< > $@
+254
.gitlab-ci/ci.template
··· 1 + # SPDX-License-Identifier: CC0-1.0 2 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 3 + 4 + {# ignore the warning, this is actually the template to edit. #} 5 + ###################################### 6 + # GENERATED - DO NOT EDIT # 7 + # see .gitlab-ci/ci.template instead # 8 + ###################################### 9 + {# 10 + useful links: 11 + https://freedesktop.pages.freedesktop.org/ci-templates/ 12 + https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html#templating-gitlab-ci-yml 13 + https://gitlab.freedesktop.org/freedesktop/ci-templates 14 + 15 + Config file used for all templates: .gitlab-ci/config.yml 16 + .gitlab-ci.yml template: .gitlab-ci/ci.template 17 + .gitlab-ci/distributions template (for reprepro): .gitlab-ci/distributions.jinja 18 + .gitlab-ci/reprepro.sh template: .gitlab-ci/reprepro.sh.jinja 19 + 20 + The following will update all files from templates: 21 + make -f .gitlab-ci/ci-scripts.mk 22 + #} 23 + 24 + variables: 25 + FDO_UPSTREAM_REPO: monado/monado 26 + 27 + .templates_sha: &templates_sha {{fdo_ci_templates_sha}} 28 + 29 + include: 30 + {% for distro in distributions %} 31 + # {{ distro.name | capitalize }} 32 + - project: "freedesktop/ci-templates" 33 + ref: *templates_sha 34 + file: "/templates/{{distro.name}}.yml" 35 + {% endfor %} 36 + 37 + {% for distro in distributions -%} {%- for image in distro.images %} 38 + 39 + # Variables for build and usage of {{ distro.name|capitalize }} {{image.codename}} image 40 + .monado.variables.{{distro.name}}:{{image.codename}}: 41 + variables: 42 + FDO_DISTRIBUTION_VERSION: "{{ image["distro_version"] | default(image.codename) }}" 43 + FDO_DISTRIBUTION_TAG: "{{image["tag"]}}" 44 + {% if "repo_suffix" in image %} 45 + FDO_REPO_SUFFIX: {{image["repo_suffix"]}} 46 + {% endif %} 47 + {% endfor -%} {%- endfor %} 48 + 49 + stages: 50 + - container_prep 51 + - build 52 + - package 53 + - reprepro 54 + - pages 55 + - deploy 56 + 57 + ### 58 + # Container prep jobs 59 + 60 + {%- for distro in distributions -%} {%- for image in distro.images %} 61 + 62 + # Make {{ distro.name|capitalize }} {{image.codename}} image 63 + {{distro.name}}:{{image.codename}}:container_prep: 64 + stage: container_prep 65 + extends: 66 + - .monado.variables.{{distro.name}}:{{image.codename}} 67 + - .fdo.container-build@{{distro.name}} # from ci-templates 68 + variables: 69 + {# The packages list is actually a mapping, not an array, but the same syntax works. #} 70 + {# Needed to be a mapping so it could be "merged" #} 71 + FDO_DISTRIBUTION_PACKAGES: '{{image.packages | sort | join(" ")}}' 72 + {% if "script" in image %} 73 + FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/{{image["script"]}}' 74 + {% endif %} 75 + {% endfor -%} {%- endfor %} 76 + 77 + {# Macro to compute job name to extend to use image given distro and image objects#} 78 + {% macro base_job_to_use_image(distro, image) %}.monado.image.{{distro.name}}:{{image.codename}}{% endmacro -%} 79 + 80 + ### 81 + # Container usage base jobs 82 + {% for distro in distributions -%} {%- for image in distro.images %} 83 + 84 + # Base for using {{ distro.name|capitalize }} {{image.codename}} image 85 + {{base_job_to_use_image(distro, image)}}: 86 + extends: 87 + - .monado.variables.{{distro.name}}:{{image.codename}} 88 + - .fdo.{{ "suffixed" if "repo_suffix" in image else "distribution" }}-image@{{distro.name}} # from ci-templates 89 + 90 + {% endfor -%} {%- endfor %} 91 + 92 + {# Macro to compute job name to extend to use image given a package we want#} 93 + {% macro base_job_to_use_image_containing(package) %} 94 + {% for distro in distributions -%} {%- for image in distro.images if package in image.packages %} 95 + {{ base_job_to_use_image(distro, image) if loop.first }} 96 + {% endfor -%} {%- endfor %} 97 + {% endmacro -%} 98 + 99 + # Style check job 100 + format-and-spellcheck: 101 + extends: 102 + - {{base_job_to_use_image_containing("codespell")}} 103 + stage: build 104 + script: 105 + - scripts/format-and-spellcheck.sh 106 + artifacts: 107 + paths: 108 + - patches/ 109 + expire_in: 1 week 110 + when: on_failure 111 + 112 + # Verify REUSE compliance 113 + reuse: 114 + stage: build 115 + image: 116 + name: fsfe/reuse:latest 117 + entrypoint: [""] 118 + script: 119 + - reuse lint 120 + 121 + {% macro make_cmake_args(cmake_defines) %} 122 + {% if cmake_defines is defined %} 123 + {%- for k, v in cmake_defines |dictsort %} -D{{ k }}={{ v }}{% endfor %} 124 + {%- endif %} 125 + {%- endmacro -%} 126 + 127 + {#### Main build jobs ####} 128 + {% for distro in distributions -%} {%- for image in distro.images -%} {%- for job in image.build_jobs %} 129 + 130 + {{job.name}}: 131 + stage: build 132 + extends: 133 + - {{base_job_to_use_image(distro, image)}} 134 + 135 + {% if job.before_script %} 136 + before_script: 137 + {% for line in job.before_script %} 138 + - {{line}} 139 + {% endfor %} 140 + {% endif %} 141 + script: 142 + - rm -rf build 143 + 144 + {#- meson builds -#} 145 + {%- if "meson" in job.name %} 146 + 147 + - meson setup build . 148 + {%- if job.args %} {{ job.args | join(' ') }}{% endif %} 149 + 150 + - ninja -C build 151 + 152 + {#- regular or NDK cmake builds -#} 153 + {%- elif "cmake" in job.name or "ndk" in job.name %} 154 + 155 + - cmake -GNinja -B build -S . {{- make_cmake_args(job.cmake_defines) }} 156 + - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt 157 + - ninja -C build 158 + 159 + {%- else %} 160 + 161 + {# error message #} 162 + CANNOT GUESS JOB TYPE 163 + 164 + {%- endif %} 165 + 166 + {%- if "cmake" in job.name %} 167 + 168 + - cd build && ctest --output-on-failure 169 + {%- endif %} 170 + 171 + {%- if job.artifact_path %} 172 + 173 + artifacts: 174 + paths: 175 + - {{ job.artifact_path }} 176 + {%- endif %} 177 + 178 + {% endfor -%} {%- endfor -%} {%- endfor %} 179 + 180 + # Packaging 181 + .monado.packaging.conditions: 182 + rules: 183 + # Only the default branch of the "upstream" repo. 184 + - if: "$CI_PROJECT_PATH == $FDO_UPSTREAM_REPO && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH" 185 + when: on_success 186 + # Otherwise, don't build packages. 187 + - when: never 188 + 189 + {% macro packaging_job_name(distro, image) -%} 190 + {{distro.name}}:{{image.codename}}:package 191 + {%- endmacro %} 192 + 193 + {% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %} 194 + 195 + {{packaging_job_name(distro, image)}}: 196 + extends: 197 + - {{base_job_to_use_image(distro, image)}} 198 + - .monado.packaging.conditions 199 + variables: 200 + DEBFULLNAME: "{{packaging.name}}" 201 + DEBEMAIL: "{{packaging.email}}" 202 + DISTRO: {{distro.name}} 203 + CODENAME: {{image.codename}} 204 + DEB_VERSION_SUFFIX: {{image.deb_version_suffix}} 205 + stage: package 206 + before_script: 207 + {# Configure git - needed despite not actually committing here. #} 208 + - git config --global user.name {{packaging.name}} 209 + - git config --global user.email {{packaging.email}} 210 + script: 211 + # Prep the source tree 212 + - git clean -dfx 213 + # Call this script to build binary and source packages. 214 + # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints. 215 + - .gitlab-ci/build-and-submit-package.sh 216 + artifacts: 217 + paths: 218 + - "incoming/" 219 + expire_in: 2 days 220 + {% endfor -%} {%- endfor %} 221 + 222 + reprepro:package: 223 + stage: reprepro 224 + extends: 225 + - {{ base_job_to_use_image_containing("reprepro") }} 226 + - .monado.packaging.conditions 227 + dependencies: 228 + {% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %} 229 + - {{packaging_job_name(distro, image)}} 230 + {% endfor -%} {%- endfor %} 231 + script: 232 + - bash .gitlab-ci/reprepro.sh 233 + artifacts: 234 + paths: 235 + - "repo/" 236 + expire_in: 2 days 237 + 238 + ### 239 + # Pages 240 + ### 241 + pages: 242 + stage: pages 243 + only: 244 + - main 245 + dependencies: 246 + - debian:cmake 247 + - reprepro:package 248 + script: 249 + - mkdir -p public 250 + - mv build/doc/html/* public/ 251 + - mv repo public/apt 252 + artifacts: 253 + paths: 254 + - public
+235
.gitlab-ci/config.yml
··· 1 + # SPDX-License-Identifier: CC0-1.0 2 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 3 + 4 + # Please run the following from the repo root after modifying this file: 5 + # make -f .gitlab-ci/ci-scripts.mk 6 + 7 + fdo_ci_templates_sha: 34039cd573a2df832d465bc9e4c5f543571f5241 8 + 9 + # These are a mapping, instead of a list/array, so we can merge. 10 + .default_debian_packages: 11 + &default_debian_packages # Packages required for build and some other basic jobs 12 + build-essential: 13 + git: 14 + wget: 15 + unzip: 16 + cmake: 17 + meson: 18 + ninja-build: 19 + libeigen3-dev: 20 + curl: 21 + patch: 22 + python3: 23 + pkg-config: 24 + libx11-dev: 25 + libx11-xcb-dev: 26 + libxxf86vm-dev: 27 + libxrandr-dev: 28 + libxcb-randr0-dev: 29 + libvulkan-dev: 30 + glslang-tools: 31 + libglvnd-dev: 32 + libgl1-mesa-dev: 33 + ca-certificates: 34 + libusb-1.0-0-dev: 35 + libudev-dev: 36 + # These are optional packages, that we're building against to ensure we build as much code as possible 37 + libhidapi-dev: 38 + libwayland-dev: 39 + libuvc-dev: 40 + libavcodec-dev: 41 + libopencv-dev: 42 + libv4l-dev: 43 + libcjson-dev: 44 + libsdl2-dev: 45 + libegl1-mesa-dev: 46 + libdbus-1-dev: 47 + libgstreamer1.0-dev: 48 + libgstreamer-plugins-base1.0-dev: 49 + libsystemd-dev: 50 + libbsd-dev: 51 + # Only used for building packages 52 + devscripts: 53 + debhelper: 54 + dput-ng: 55 + gettext-base: 56 + pandoc: 57 + 58 + # These config defines are used for all NDK builds 59 + .android_cmake_defines: &android_cmake_defines 60 + ANDROID_PLATFORM: 26 61 + CMAKE_TOOLCHAIN_FILE: /opt/android-ndk/build/cmake/android.toolchain.cmake 62 + Eigen3_DIR: /usr/lib/cmake/eigen3/ 63 + EIGEN3_INCLUDE_DIR: /usr/include/eigen3 64 + 65 + # The distributions we'll make an image for 66 + distributions: 67 + - name: debian 68 + images: 69 + # This image does some extra work. 70 + - codename: bullseye 71 + script: i386_and_proclamation_container_prep.sh 72 + tag: "2022-01-19.0" 73 + deb_version_suffix: bpo11 74 + packages: 75 + <<: *default_debian_packages 76 + codespell: 77 + doxygen: 78 + graphviz: 79 + python3-pip: 80 + python3-click: 81 + clang-format: 82 + build_jobs: 83 + - name: "debian:cmake" 84 + # Generate "changes since last release" and add to changelog, 85 + # since this is the build that makes our docs. 86 + before_script: 87 + - pushd doc/changes 88 + - proclamation build --overwrite vNEXT 89 + - popd 90 + artifact_path: build/doc/html/ 91 + 92 + - name: "debian:cmake-no-opencv" 93 + cmake_defines: 94 + BUILD_DOC: "OFF" 95 + XRT_HAVE_OPENCV: "OFF" 96 + 97 + - name: "debian:cmake-no-sdl2" 98 + cmake_defines: 99 + BUILD_DOC: "OFF" 100 + XRT_HAVE_SDL2: "OFF" 101 + 102 + - name: "debian:cmake-no-service" 103 + cmake_defines: 104 + BUILD_DOC: "OFF" 105 + XRT_FEATURE_SERVICE: "OFF" 106 + 107 + - name: "debian:cmake:32bit" 108 + cmake_defines: 109 + CMAKE_TOOLCHAIN_FILE: .gitlab-ci/i386.cmake 110 + # OpenCV doesn't play nicely with us in multi-arch. 111 + XRT_HAVE_OPENCV: "OFF" 112 + 113 + - name: "debian:meson" 114 + 115 + - name: "debian:meson:32bit" 116 + args: 117 + - --prefix=/usr 118 + - --libdir=/usr/lib/i386-linux-gnu 119 + - --cross-file=.gitlab-ci/i386-cross.txt 120 + 121 + # This one is pretty minimal, compared to the others. 122 + - codename: bullseye-ndk 123 + distro_version: bullseye 124 + repo_suffix: ndk 125 + script: ndk_container_prep.sh 126 + tag: "2022-01-19.0" 127 + packages: 128 + git: 129 + wget: 130 + unzip: 131 + cmake: 132 + meson: 133 + ninja-build: 134 + libeigen3-dev: 135 + python3: 136 + pkg-config: 137 + ca-certificates: 138 + glslang-tools: 139 + build_jobs: 140 + - name: "ndk:armeabi-v7a" 141 + cmake_defines: 142 + <<: *android_cmake_defines 143 + BUILD_DOC: "OFF" 144 + ANDROID_ABI: armeabi-v7a 145 + 146 + - name: "ndk:arm64-v8a" 147 + cmake_defines: 148 + <<: *android_cmake_defines 149 + BUILD_DOC: "OFF" 150 + ANDROID_ABI: arm64-v8a 151 + 152 + - name: ubuntu 153 + images: 154 + # LTS 155 + - codename: focal 156 + distro_version: "20.04" 157 + tag: "2021-10-27.1" 158 + deb_version_suffix: ubuntu2004 159 + packages: 160 + <<: *default_debian_packages 161 + build_jobs: 162 + - name: "ubuntu:cmake" 163 + cmake_defines: 164 + BUILD_DOC: "OFF" 165 + 166 + - name: "ubuntu:meson" 167 + 168 + - codename: hirsute 169 + distro_version: "21.04" 170 + tag: "2021-10-27.1" 171 + deb_version_suffix: ubuntu2104 172 + packages: 173 + <<: *default_debian_packages 174 + 175 + - codename: impish 176 + distro_version: "21.10" 177 + tag: "2021-10-28.0" 178 + deb_version_suffix: ubuntu2110 179 + packages: 180 + <<: *default_debian_packages 181 + reprepro: 182 + build_jobs: 183 + - name: "ubuntu:latest:cmake" 184 + cmake_defines: 185 + BUILD_DOC: "OFF" 186 + 187 + - name: arch 188 + images: 189 + - codename: rolling 190 + tag: "2021-09-14.0" 191 + packages: 192 + git: 193 + gcc: 194 + clang: 195 + cmake: 196 + meson: 197 + ninja: 198 + pkgconfig: 199 + python3: 200 + diffutils: 201 + patch: 202 + doxygen: 203 + graphviz: 204 + eigen: 205 + hidapi: 206 + libxrandr: 207 + mesa: 208 + glslang: 209 + vulkan-headers: 210 + vulkan-icd-loader: 211 + check: 212 + glfw-x11: 213 + libusb: 214 + opencv: 215 + gtk3: 216 + ffmpeg: 217 + v4l-utils: 218 + qt5-base: 219 + build_jobs: 220 + - name: "arch:cmake" 221 + 222 + - name: "arch:cmake:clang" 223 + cmake_defines: 224 + CMAKE_C_COMPILER: /usr/bin/clang 225 + CMAKE_CXX_COMPILER: /usr/bin/clang++ 226 + 227 + - name: "arch:meson" 228 + 229 + android: 230 + platform: 26 231 + 232 + packaging: 233 + # Name and email associated with the package 234 + name: "Monado CI" 235 + email: "ryan.pavlik@collabora.com"
-4
.gitlab-ci/debian_bullseye_container_prep.sh .gitlab-ci/i386_and_proclamation_container_prep.sh
··· 6 6 cd $(dirname $0) 7 7 bash ./install-cross.sh 8 8 ) 9 - ( 10 - cd $(dirname $0) 11 - bash ./build-openxr-openhmd.sh 12 - ) 13 9 14 10 python3 -m pip install proclamation
-12
.gitlab-ci/debian_buster_container_prep.sh
··· 1 - #!/bin/bash 2 - # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 - # SPDX-License-Identifier: BSL-1.0 4 - 5 - ( 6 - cd $(dirname $0) 7 - bash ./install-cross.sh 8 - ) 9 - ( 10 - cd $(dirname $0) 11 - bash ./build-openxr-openhmd.sh 12 - )
-7
.gitlab-ci/distributions
··· 1 - Origin: monado.freedesktop.org 2 - Description: Monado CI apt repository 3 - Codename: ${DISTRO} 4 - Architectures: amd64 i386 source 5 - Components: main 6 - Tracking: minimal 7 - SignWith: ${MONADO_GPG_FINGERPRINT}
+34
.gitlab-ci/distributions.jinja
··· 1 + {# 2 + Copyright 2020-2022, Collabora, Ltd. 3 + 4 + SPDX-License-Identifier: BSL-1.0 5 + #} 6 + {# 7 + Template for reprepro distributions config file. 8 + 9 + After this template gets expanded, with a paragraph for each 10 + distribution codename supported, 11 + the GPG fingerprint gets substituted into that at CI time using envsubst, 12 + (not ahead of time using ci-fairy) 13 + because the fingerprint is included in the "secrets" in CI. 14 + 15 + Note: There is no way to indicate comments in the reprepro distributions config 16 + file format, and whitespace is meaningful (need blank lines between paragraphs). 17 + 18 + Please run the following after modifying this file: 19 + 20 + ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/distributions.template > .gitlab-ci/distributions 21 + 22 + #} 23 + {% for distro in packaging.distribution_suffixes %} 24 + {% for codename in packaging.distribution_suffixes[distro] %} 25 + Origin: monado.freedesktop.org 26 + Description: Monado CI apt repository 27 + Codename: {{ codename }} 28 + Architectures: amd64 i386 source 29 + Components: main 30 + Tracking: minimal 31 + SignWith: ${MONADO_GPG_FINGERPRINT} 32 + 33 + {% endfor %} 34 + {% endfor %}
+4 -2
.gitlab-ci/distributions.license
··· 1 - Copyright 2020, Collabora, Ltd. 1 + Copyright 2020-2022, Collabora, Ltd. 2 2 3 - SPDX-License-Identifier: BSL-1.0 3 + SPDX-License-Identifier: BSL-1.0 4 + 5 + Generated from distributions.template with ci-fairy
+5
.gitlab-ci/gpg-agent.conf
··· 1 + # SPDX-License-Identifier: CC0-1.0 2 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 3 + 4 + # Used for CI package building. 5 + allow-loopback-pinentry
+6
.gitlab-ci/gpg.conf
··· 1 + # SPDX-License-Identifier: CC0-1.0 2 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 3 + 4 + # Used for CI package building. 5 + use-agent 6 + pinentry-mode loopback
+63
.gitlab-ci/reprepro.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 + 5 + ############################################### 6 + # GENERATED - DO NOT EDIT # 7 + # see .gitlab-ci/reprepro.sh.template instead # 8 + ############################################### 9 + 10 + 11 + set -euo pipefail 12 + 13 + # Convince gnupg to work properly in CI 14 + mkdir -p ~/.gnupg && chmod 700 ~/.gnupg 15 + cp .gitlab-ci/gpg.conf .gitlab-ci/gpg-agent.conf ~/.gnupg 16 + echo RELOADAGENT | gpg-connect-agent 17 + gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase "${MONADO_GPG_PASSPHRASE}" --import "${MONADO_GPG_SECRET_KEY}" 18 + mkdir -p repo/conf 19 + # Substitute in the GPG fingerprint into the repository config. 20 + # This file is itself generated with ci-fairy. 21 + envsubst < .gitlab-ci/distributions >> repo/conf/distributions 22 + 23 + # For each distro, sign the changes file and add it to the repo. 24 + 25 + # bullseye 26 + if [ -f "incoming/bullseye.distro" ]; then 27 + VERSION=$(cat incoming/bullseye.distro) 28 + echo "Signing and processing bullseye: ${VERSION}" 29 + debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes" 30 + reprepro -V --ignore=wrongdistribution -b repo include bullseye "incoming/monado_${VERSION}_amd64.changes" 31 + else 32 + echo "Skipping bullseye - no artifact found" 33 + fi 34 + 35 + # focal 36 + if [ -f "incoming/focal.distro" ]; then 37 + VERSION=$(cat incoming/focal.distro) 38 + echo "Signing and processing focal: ${VERSION}" 39 + debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes" 40 + reprepro -V --ignore=wrongdistribution -b repo include focal "incoming/monado_${VERSION}_amd64.changes" 41 + else 42 + echo "Skipping focal - no artifact found" 43 + fi 44 + 45 + # hirsute 46 + if [ -f "incoming/hirsute.distro" ]; then 47 + VERSION=$(cat incoming/hirsute.distro) 48 + echo "Signing and processing hirsute: ${VERSION}" 49 + debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes" 50 + reprepro -V --ignore=wrongdistribution -b repo include hirsute "incoming/monado_${VERSION}_amd64.changes" 51 + else 52 + echo "Skipping hirsute - no artifact found" 53 + fi 54 + 55 + # impish 56 + if [ -f "incoming/impish.distro" ]; then 57 + VERSION=$(cat incoming/impish.distro) 58 + echo "Signing and processing impish: ${VERSION}" 59 + debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes" 60 + reprepro -V --ignore=wrongdistribution -b repo include impish "incoming/monado_${VERSION}_amd64.changes" 61 + else 62 + echo "Skipping impish - no artifact found" 63 + fi
+42
.gitlab-ci/reprepro.sh.jinja
··· 1 + #!/usr/bin/env bash 2 + # SPDX-License-Identifier: CC0-1.0 3 + # SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors 4 + 5 + {# ignore the warning, this is actually the template to edit. #} 6 + ############################################### 7 + # GENERATED - DO NOT EDIT # 8 + # see .gitlab-ci/reprepro.sh.template instead # 9 + ############################################### 10 + {# 11 + Please run the following after editing: 12 + ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/reprepro.sh.template > .gitlab-ci/reprepro.sh 13 + #} 14 + 15 + 16 + set -euo pipefail 17 + 18 + # Convince gnupg to work properly in CI 19 + mkdir -p ~/.gnupg && chmod 700 ~/.gnupg 20 + cp .gitlab-ci/gpg.conf .gitlab-ci/gpg-agent.conf ~/.gnupg 21 + echo RELOADAGENT | gpg-connect-agent 22 + gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase "${MONADO_GPG_PASSPHRASE}" --import "${MONADO_GPG_SECRET_KEY}" 23 + mkdir -p repo/conf 24 + # Substitute in the GPG fingerprint into the repository config. 25 + # This file is itself generated with ci-fairy. 26 + envsubst < .gitlab-ci/distributions >> repo/conf/distributions 27 + 28 + # For each distro, sign the changes file and add it to the repo. 29 + {% for distro in distributions | sort(attribute="name") %} 30 + {% for image in distro.images if "deb_version_suffix" in image %} 31 + 32 + # {{ image.codename }} 33 + if [ -f "incoming/{{image.codename}}.distro" ]; then 34 + VERSION=$(cat incoming/{{image.codename}}.distro) 35 + echo "Signing and processing {{image.codename}}: ${VERSION}" 36 + debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes" 37 + reprepro -V --ignore=wrongdistribution -b repo include {{image.codename}} "incoming/monado_${VERSION}_amd64.changes" 38 + else 39 + echo "Skipping {{image.codename}} - no artifact found" 40 + fi 41 + {% endfor %} 42 + {% endfor %}
-7
.gitlab-ci/ubuntu_focal_container_prep.sh
··· 1 - #!/bin/bash 2 - # Copyright 2018-2020, Collabora, Ltd. and the Monado contributors 3 - # SPDX-License-Identifier: BSL-1.0 4 - ( 5 - cd $(dirname $0) 6 - bash ./build-openxr-openhmd.sh 7 - )
-5
.gitlab-ci/ubuntu_hirsute_container_prep.sh
··· 1 - #!/bin/bash 2 - # Copyright 2021, Collabora, Ltd. and the Monado contributors 3 - # SPDX-License-Identifier: BSL-1.0 4 - 5 - # Nothing really needed.
-5
.gitlab-ci/ubuntu_impish_container_prep.sh
··· 1 - #!/bin/bash 2 - # Copyright 2021, Collabora, Ltd. and the Monado contributors 3 - # SPDX-License-Identifier: BSL-1.0 4 - 5 - # Nothing really needed.