···11# SPDX-License-Identifier: CC0-1.0
22-# SPDX-FileCopyrightText: 2018-2021 Collabora, Ltd. and the Monado contributors
22+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
33+44+######################################
55+# GENERATED - DO NOT EDIT #
66+# see .gitlab-ci/ci.template instead #
77+######################################
3849variables:
510 FDO_UPSTREAM_REPO: monado/monado
61177-.templates_sha: &templates_sha 14731f78c23c7b523a85a26a068ade9ac1ecd2f3
1212+.templates_sha: &templates_sha 34039cd573a2df832d465bc9e4c5f543571f5241
81399-# Variables listing packages for Debian-based distros
1010-.monado.variables.debian-based-packages:
1111- variables:
1212- # Packages required for build and some other basic jobs
1313- 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"
1414-1515- # These are optional packages, that we're building against to ensure we build as much code as possible
1616- 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"
1717-1818- # Only used for building packages
1919- PACKAGING_PACKAGES: "devscripts debhelper dput-ng gettext-base pandoc"
1414+include:
1515+ # Debian
1616+ - project: "freedesktop/ci-templates"
1717+ ref: *templates_sha
1818+ file: "/templates/debian.yml"
1919+ # Ubuntu
2020+ - project: "freedesktop/ci-templates"
2121+ ref: *templates_sha
2222+ file: "/templates/ubuntu.yml"
2323+ # Arch
2424+ - project: "freedesktop/ci-templates"
2525+ ref: *templates_sha
2626+ file: "/templates/arch.yml"
20272121- # Used for ancillary "not compilation" jobs/features, like docs, changelogs, formatting, etc.
2222- TOOLS_REQUIRED_PACKAGES: "codespell doxygen graphviz python3-pip python3-click"
23282424- # The NDK builder uses only these packages
2525- NDK_PACKAGES: "git wget unzip cmake meson ninja-build libeigen3-dev python3 pkg-config ca-certificates glslang-tools"
2626-2727-# Variables for build and usage of Debian 10 (Buster) image
2828-.monado.variables.debian:buster:
2929+# Variables for build and usage of Debian bullseye image
3030+.monado.variables.debian:bullseye:
2931 variables:
3030- FDO_DISTRIBUTION_VERSION: buster
3131- FDO_DISTRIBUTION_TAG: "2022-01-21.0"
3232+ FDO_DISTRIBUTION_VERSION: "bullseye"
3333+ FDO_DISTRIBUTION_TAG: "2022-01-24.0"
32343333-# Variables for build and usage of Debian 11 (Bullseye) image
3434-.monado.variables.debian:bullseye:
3535+# Variables for build and usage of Debian bullseye-ndk image
3636+.monado.variables.debian:bullseye-ndk:
3537 variables:
3636- FDO_DISTRIBUTION_VERSION: bullseye
3737- FDO_DISTRIBUTION_TAG: "2022-01-21.0"
3838+ FDO_DISTRIBUTION_VERSION: "bullseye"
3939+ FDO_DISTRIBUTION_TAG: "2022-01-24.0"
4040+ FDO_REPO_SUFFIX: ndk
38413939-# Variables for build and usage of Ubuntu 20.04 LTS (Focal) image
4242+# Variables for build and usage of Ubuntu focal image
4043.monado.variables.ubuntu:focal:
4144 variables:
4245 FDO_DISTRIBUTION_VERSION: "20.04"
4343- FDO_DISTRIBUTION_TAG: "2022-01-21.0"
4646+ FDO_DISTRIBUTION_TAG: "2022-01-24.0"
44474545-# Variables for build and usage of Ubuntu 21.04 (Hirsute) image
4848+# Variables for build and usage of Ubuntu hirsute image
4649.monado.variables.ubuntu:hirsute:
4750 variables:
4851 FDO_DISTRIBUTION_VERSION: "21.04"
4949- FDO_DISTRIBUTION_TAG: "2022-01-21.0"
5252+ FDO_DISTRIBUTION_TAG: "2022-01-24.0"
50535151-# Variables for build and usage of Ubuntu 21.10 (Impish) image
5454+# Variables for build and usage of Ubuntu impish image
5255.monado.variables.ubuntu:impish:
5356 variables:
5457 FDO_DISTRIBUTION_VERSION: "21.10"
5555- FDO_DISTRIBUTION_TAG: "2022-01-21.0"
5656-5757-# Variables for build and usage of Debian 10 (Buster) + Android NDK image
5858-.monado.variables.debian:buster-ndk:
5959- variables:
6060- FDO_DISTRIBUTION_VERSION: buster
6161- FDO_DISTRIBUTION_TAG: "2022-01-21.2"
6262- FDO_REPO_SUFFIX: ndk
5858+ FDO_DISTRIBUTION_TAG: "2022-01-24.0"
63596464-# Variables for build and usage of Arch Linux image
6060+# Variables for build and usage of Arch rolling image
6561.monado.variables.arch:rolling:
6662 variables:
6767- FDO_DISTRIBUTION_TAG: "2022-01-21.0"
6868-6969-include:
7070- - project: "freedesktop/ci-templates"
7171- ref: *templates_sha
7272- file: "/templates/debian.yml"
7373- - project: "freedesktop/ci-templates"
7474- ref: *templates_sha
7575- file: "/templates/ubuntu.yml"
7676- - project: "freedesktop/ci-templates"
7777- ref: *templates_sha
7878- file: "/templates/arch.yml"
6363+ FDO_DISTRIBUTION_VERSION: "rolling"
6464+ FDO_DISTRIBUTION_TAG: "2022-01-24.0"
79658066stages:
8167 - container_prep
···87738874###
8975# Container prep jobs
9090-9191-# Base for all container prep
9292-.monado.variables.container-prep-base:
9393- # "stage" set here doesn't work, for some reason
9494- variables:
9595- # no need to pull the whole tree for rebuilding the image - is this still needed?
9696- GIT_STRATEGY: none
9797- # Each most-derived container prep job has a script to set up stuff for it.
9898- FDO_DISTRIBUTION_EXEC: "bash .gitlab-ci/$(echo ${CI_JOB_NAME} | sed 's/:/_/g').sh"
9999-100100-# Debian Buster (x64 + i386)
101101-debian:buster:container_prep:
102102- stage: container_prep
103103- extends:
104104- - .monado.variables.debian:buster
105105- - .monado.variables.container-prep-base
106106- - .monado.variables.debian-based-packages
107107- - .fdo.container-build@debian # from ci-templates
108108- variables:
109109- # a list of packages to install - assembled from .monado.variables.debian-based-packages, plus clang-format-7 (which we don't actually need anymore)
110110- FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES} clang-format-7"
111111-112112-# Debian Bullseye (x64 + i386)
7676+# Make Debian bullseye image
11377debian:bullseye:container_prep:
11478 stage: container_prep
11579 extends:
11680 - .monado.variables.debian:bullseye
117117- - .monado.variables.container-prep-base
118118- - .monado.variables.debian-based-packages
11981 - .fdo.container-build@debian # from ci-templates
12082 variables:
121121- # a list of packages to install - assembled from .monado.variables.debian-based-packages, plus clang-format.
122122- FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES} clang-format"
8383+ 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'
8484+ FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/i386_and_proclamation_container_prep.sh'
12385124124-# Arch Linux (x64)
125125-arch:container_prep:
8686+# Make Debian bullseye-ndk image
8787+debian:bullseye-ndk:container_prep:
12688 stage: container_prep
12789 extends:
128128- - .monado.variables.arch:rolling
129129- - .monado.variables.container-prep-base
130130- - .fdo.container-build@arch # from ci-templates
9090+ - .monado.variables.debian:bullseye-ndk
9191+ - .fdo.container-build@debian # from ci-templates
13192 variables:
132132- # a list of packages to install
133133- 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"
9393+ FDO_DISTRIBUTION_PACKAGES: 'ca-certificates cmake git glslang-tools libeigen3-dev meson ninja-build pkg-config python3 unzip wget'
9494+ FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/ndk_container_prep.sh'
13495135135-# Ubuntu Focal (x64)
9696+# Make Ubuntu focal image
13697ubuntu:focal:container_prep:
13798 stage: container_prep
13899 extends:
139100 - .monado.variables.ubuntu:focal
140140- - .monado.variables.container-prep-base
141141- - .monado.variables.debian-based-packages
142101 - .fdo.container-build@ubuntu # from ci-templates
143102 variables:
144144- # a list of packages to install - assembled from .monado.variables.debian-based-packages
145145- FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES}"
103103+ 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'
146104147147-# Ubuntu Hirsute (x64)
105105+# Make Ubuntu hirsute image
148106ubuntu:hirsute:container_prep:
149107 stage: container_prep
150108 extends:
151109 - .monado.variables.ubuntu:hirsute
152152- - .monado.variables.container-prep-base
153153- - .monado.variables.debian-based-packages
154110 - .fdo.container-build@ubuntu # from ci-templates
155111 variables:
156156- # a list of packages to install - assembled from .monado.variables.debian-based-packages
157157- FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES}"
112112+ 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'
158113159159-# Ubuntu Impish (x64)
114114+# Make Ubuntu impish image
160115ubuntu:impish:container_prep:
161116 stage: container_prep
162117 extends:
163118 - .monado.variables.ubuntu:impish
164164- - .monado.variables.container-prep-base
165165- - .monado.variables.debian-based-packages
166119 - .fdo.container-build@ubuntu # from ci-templates
167120 variables:
168168- # a list of packages to install - assembled from .monado.variables.debian-based-packages, plus reprepro
169169- FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} reprepro"
121121+ 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'
170122171171-# Debian Buster + the Android NDK in /opt/android-ndk
172172-# The NDK itself gets installed by .gitlab-ci/ndk:container_prep.sh
173173-ndk:container_prep:
123123+# Make Arch rolling image
124124+arch:rolling:container_prep:
174125 stage: container_prep
175126 extends:
176176- - .monado.variables.debian:buster-ndk
177177- - .monado.variables.container-prep-base
178178- - .monado.variables.debian-based-packages
179179- - .fdo.container-build@debian # from ci-templates
127127+ - .monado.variables.arch:rolling
128128+ - .fdo.container-build@arch # from ci-templates
180129 variables:
181181- # Repo suffix is set in .monado.variables.debian:buster-ndk
182182- # a list of packages to install
183183- FDO_DISTRIBUTION_PACKAGES: "${NDK_PACKAGES}"
130130+ 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'
184131185185-# Style check job
186186-format-and-spellcheck:
132132+###
133133+# Container usage base jobs
134134+135135+# Base for using Debian bullseye image
136136+.monado.image.debian:bullseye:
187137 extends:
188138 - .monado.variables.debian:bullseye
189139 - .fdo.distribution-image@debian # from ci-templates
140140+141141+142142+# Base for using Debian bullseye-ndk image
143143+.monado.image.debian:bullseye-ndk:
144144+ extends:
145145+ - .monado.variables.debian:bullseye-ndk
146146+ - .fdo.suffixed-image@debian # from ci-templates
147147+148148+149149+# Base for using Ubuntu focal image
150150+.monado.image.ubuntu:focal:
151151+ extends:
152152+ - .monado.variables.ubuntu:focal
153153+ - .fdo.distribution-image@ubuntu # from ci-templates
154154+155155+156156+# Base for using Ubuntu hirsute image
157157+.monado.image.ubuntu:hirsute:
158158+ extends:
159159+ - .monado.variables.ubuntu:hirsute
160160+ - .fdo.distribution-image@ubuntu # from ci-templates
161161+162162+163163+# Base for using Ubuntu impish image
164164+.monado.image.ubuntu:impish:
165165+ extends:
166166+ - .monado.variables.ubuntu:impish
167167+ - .fdo.distribution-image@ubuntu # from ci-templates
168168+169169+170170+# Base for using Arch rolling image
171171+.monado.image.arch:rolling:
172172+ extends:
173173+ - .monado.variables.arch:rolling
174174+ - .fdo.distribution-image@arch # from ci-templates
175175+176176+177177+# Style check job
178178+format-and-spellcheck:
179179+ extends:
180180+ - .monado.image.debian:bullseye
181181+190182 stage: build
191183 script:
192184 - scripts/format-and-spellcheck.sh
···205197 script:
206198 - reuse lint
207199208208-# "Base" job for a CMake build
209209-.monado.base-job.build-cmake:
210210- stage: build
211211- script:
212212- - rm -rf build
213213- - mkdir build
214214- - pushd build
215215- - cmake -GNinja .. $CMAKE_ARGS
216216- # List build options
217217- - grep "^XRT_" CMakeCache.txt
218218- - ninja
219219- - ctest --output-on-failure
220200221221-# "Base" job for a Meson build
222222-.monado.base-job.build-meson:
201201+debian:cmake:
223202 stage: build
224224- script:
225225- - rm -rf build
226226- - mkdir build
227227- - pushd build
228228- - meson .. $MESON_ARGS
229229- - ninja
230230-231231-debian:bullseye:cmake:
232203 extends:
233233- - .monado.variables.debian:bullseye
234234- - .fdo.distribution-image@debian # from ci-templates
235235- - .monado.base-job.build-cmake
204204+ - .monado.image.debian:bullseye
205205+236206 before_script:
237237- # Generate "changes since last release" and add to changelog,
238238- # since this is the build that makes our docs.
239207 - pushd doc/changes
240208 - proclamation build --overwrite vNEXT
241209 - popd
210210+ script:
211211+ - rm -rf build
212212+ - cmake -GNinja -B build -S .
213213+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
214214+ - ninja -C build
215215+ - cd build && ctest --output-on-failure
242216 artifacts:
243217 paths:
244218 - build/doc/html/
245219246220debian:cmake-no-opencv:
221221+ stage: build
247222 extends:
248248- - .monado.variables.debian:buster
249249- - .fdo.distribution-image@debian # from ci-templates
250250- - .monado.base-job.build-cmake
251251- variables:
252252- CMAKE_ARGS: -DXRT_HAVE_OPENCV=OFF
223223+ - .monado.image.debian:bullseye
253224254254-debian:cmake-no-opengl:
255255- extends:
256256- - .monado.variables.debian:buster
257257- - .fdo.distribution-image@debian # from ci-templates
258258- - .monado.base-job.build-cmake
259259- variables:
260260- CMAKE_ARGS: -DXRT_HAVE_OPENGL=OFF
225225+ script:
226226+ - rm -rf build
227227+ - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_HAVE_OPENCV=OFF
228228+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
229229+ - ninja -C build
230230+ - cd build && ctest --output-on-failure
261231262232debian:cmake-no-sdl2:
233233+ stage: build
263234 extends:
264264- - .monado.variables.debian:buster
265265- - .fdo.distribution-image@debian # from ci-templates
266266- - .monado.base-job.build-cmake
267267- variables:
268268- CMAKE_ARGS: -DXRT_HAVE_SDL2=OFF
235235+ - .monado.image.debian:bullseye
236236+237237+ script:
238238+ - rm -rf build
239239+ - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_HAVE_SDL2=OFF
240240+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
241241+ - ninja -C build
242242+ - cd build && ctest --output-on-failure
269243270244debian:cmake-no-service:
245245+ stage: build
271246 extends:
272272- - .monado.variables.debian:buster
273273- - .fdo.distribution-image@debian # from ci-templates
274274- - .monado.base-job.build-cmake
275275- variables:
276276- CMAKE_ARGS: -DXRT_FEATURE_SERVICE=OFF
247247+ - .monado.image.debian:bullseye
277248278278-arch:cmake:
249249+ script:
250250+ - rm -rf build
251251+ - cmake -GNinja -B build -S . -DBUILD_DOC=OFF -DXRT_FEATURE_SERVICE=OFF
252252+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
253253+ - ninja -C build
254254+ - cd build && ctest --output-on-failure
255255+256256+debian:cmake:32bit:
257257+ stage: build
279258 extends:
280280- - .monado.variables.arch:rolling
281281- - .fdo.distribution-image@arch # from ci-templates
282282- - .monado.base-job.build-cmake
259259+ - .monado.image.debian:bullseye
283260284284-arch:cmake:clang:
261261+ script:
262262+ - rm -rf build
263263+ - cmake -GNinja -B build -S . -DCMAKE_TOOLCHAIN_FILE=.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=OFF
264264+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
265265+ - ninja -C build
266266+ - cd build && ctest --output-on-failure
267267+268268+debian:meson:
269269+ stage: build
285270 extends:
286286- - .monado.variables.arch:rolling
287287- - .fdo.distribution-image@arch # from ci-templates
288288- - .monado.base-job.build-cmake
289289- variables:
290290- CMAKE_ARGS: -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
271271+ - .monado.image.debian:bullseye
272272+273273+ script:
274274+ - rm -rf build
275275+ - meson setup build .
276276+ - ninja -C build
277277+278278+debian:meson:32bit:
279279+ stage: build
280280+ extends:
281281+ - .monado.image.debian:bullseye
282282+283283+ script:
284284+ - rm -rf build
285285+ - meson setup build . --prefix=/usr --libdir=/usr/lib/i386-linux-gnu --cross-file=.gitlab-ci/i386-cross.txt
286286+ - ninja -C build
287287+288288+ndk:armeabi-v7a:
289289+ stage: build
290290+ extends:
291291+ - .monado.image.debian:bullseye-ndk
292292+293293+ script:
294294+ - rm -rf build
295295+ - 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
296296+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
297297+ - ninja -C build
298298+299299+ndk:arm64-v8a:
300300+ stage: build
301301+ extends:
302302+ - .monado.image.debian:bullseye-ndk
303303+304304+ script:
305305+ - rm -rf build
306306+ - 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
307307+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
308308+ - ninja -C build
291309292310ubuntu:cmake:
311311+ stage: build
293312 extends:
294294- - .monado.variables.ubuntu:focal
295295- - .fdo.distribution-image@ubuntu # from ci-templates
296296- - .monado.base-job.build-cmake
313313+ - .monado.image.ubuntu:focal
297314298298-debian:meson:
299299- extends:
300300- - .monado.variables.debian:buster
301301- - .fdo.distribution-image@debian # from ci-templates
302302- - .monado.base-job.build-meson
315315+ script:
316316+ - rm -rf build
317317+ - cmake -GNinja -B build -S . -DBUILD_DOC=OFF
318318+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
319319+ - ninja -C build
320320+ - cd build && ctest --output-on-failure
303321304322ubuntu:meson:
323323+ stage: build
305324 extends:
306306- - .monado.variables.ubuntu:focal
307307- - .fdo.distribution-image@ubuntu # from ci-templates
308308- - .monado.base-job.build-meson
325325+ - .monado.image.ubuntu:focal
309326310310-arch:meson:
327327+ script:
328328+ - rm -rf build
329329+ - meson setup build .
330330+ - ninja -C build
331331+332332+ubuntu:latest:cmake:
333333+ stage: build
311334 extends:
312312- - .monado.variables.arch:rolling
313313- - .fdo.distribution-image@arch # from ci-templates
314314- - .monado.base-job.build-meson
315315- variables:
316316- MESON_ARGS: -Ddocs=disabled
335335+ - .monado.image.ubuntu:impish
336336+337337+ script:
338338+ - rm -rf build
339339+ - cmake -GNinja -B build -S . -DBUILD_DOC=OFF
340340+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
341341+ - ninja -C build
342342+ - cd build && ctest --output-on-failure
317343318318-# Cross-compiling
319319-debian:meson:32bit:
344344+arch:cmake:
345345+ stage: build
320346 extends:
321321- - .monado.variables.debian:buster
322322- - .fdo.distribution-image@debian # from ci-templates
323323- - .monado.base-job.build-meson
324324- variables:
325325- MESON_ARGS: --prefix /usr --libdir /usr/lib/i386-linux-gnu --cross-file ../.gitlab-ci/i386-cross.txt
347347+ - .monado.image.arch:rolling
326348327327-debian:cmake:32bit:
328328- extends:
329329- - .monado.variables.debian:buster
330330- - .fdo.distribution-image@debian # from ci-templates
331331- - .monado.base-job.build-cmake
332332- variables:
333333- # OpenCV and local OpenHMD doesn't play nicely with us in multi-arch.
334334- CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DXRT_HAVE_OPENCV=off -DXRT_BUILD_DRIVER_OHMD=off
349349+ script:
350350+ - rm -rf build
351351+ - cmake -GNinja -B build -S .
352352+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
353353+ - ninja -C build
354354+ - cd build && ctest --output-on-failure
335355336336-# Base of Android NDK builds.
337337-# Takes the last :-delimited part of the name as the ABI to build for,
338338-# so you don't need to do anything other than "extends" in the job
339339-.monado.ndk:build-base:
356356+arch:cmake:clang:
340357 stage: build
341358 extends:
342342- - .monado.variables.debian:buster-ndk
343343- - .fdo.suffixed-image@debian # from ci-templates
344344- variables:
345345- ANDROID_PLATFORM: 26
359359+ - .monado.image.arch:rolling
360360+346361 script:
347347- - mkdir build
348348- - pushd build
349349- # This extracts the ABI from the job name
350350- - export ABI=$(echo $CI_JOB_NAME | cut --delimiter=":" -f 2)
351351- # Note we are pointing CMake to the host install of Eigen3 because it's header-only
352352- # and thus this is safe to do.
353353- - 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/
354354- - grep "^XRT_" CMakeCache.txt
355355- - ninja
362362+ - rm -rf build
363363+ - cmake -GNinja -B build -S . -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++
364364+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
365365+ - ninja -C build
366366+ - cd build && ctest --output-on-failure
356367357357-ndk:armeabi-v7a:
358358- extends: .monado.ndk:build-base
368368+arch:meson:
369369+ stage: build
370370+ extends:
371371+ - .monado.image.arch:rolling
359372360360-ndk:arm64-v8a:
361361- extends: .monado.ndk:build-base
373373+ script:
374374+ - rm -rf build
375375+ - meson setup build .
376376+ - ninja -C build
362377363378# Packaging
364379.monado.packaging.conditions:
···369384 # Otherwise, don't build packages.
370385 - when: never
371386372372-.monado.base-job.debuild:
387387+388388+389389+debian:bullseye:package:
373390 extends:
391391+ - .monado.image.debian:bullseye
374392 - .monado.packaging.conditions
393393+ variables:
394394+ GIT_STRATEGY: clone
395395+ DEBFULLNAME: "Monado CI"
396396+ DEBEMAIL: "ryan.pavlik@collabora.com"
397397+ DISTRO: debian
398398+ CODENAME: bullseye
399399+ DEB_VERSION_SUFFIX: bpo11
375400 stage: package
376401 before_script:
377377- # Configure git - needed despite not actually committing here.
378378- - git config --global user.email "ryan.pavlik@collabora.com"
379379- - git config --global user.name "Monado CI"
402402+ - git config --global user.name Monado CI
403403+ - git config --global user.email ryan.pavlik@collabora.com
380404 script:
381405 # Prep the source tree
382406 - git clean -dfx
383383- - git merge origin/${PACKAGE_BRANCH} --no-commit
384384- - 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")
385385- # Build the package
386386- - debuild -uc -us
387387- # Use dput-ng to move the package-related files into some artifacts.
388388- - export INCOMING=$(pwd)/incoming
389389- - mkdir -p $INCOMING
390390- - mkdir -p ~/.dput.d/profiles
391391- - cat .gitlab-ci/localhost.json | envsubst > ~/.dput.d/profiles/localhost.json
392392- - dpkg-parsechangelog --show-field version > incoming/${DISTRO}.distro
393393- - dput --debug localhost ../monado_$(dpkg-parsechangelog --show-field version)_amd64.changes
407407+ # Call this script to build binary and source packages.
408408+ # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
409409+ - .gitlab-ci/build-and-submit-package.sh
394410 artifacts:
395411 paths:
396412 - "incoming/"
397413 expire_in: 2 days
398414399399-debian:buster:package:
400400- extends:
401401- - .monado.variables.debian:buster
402402- - .fdo.distribution-image@debian # from ci-templates
403403- - .monado.base-job.debuild
404404- variables:
405405- BACKPORT_SUFFIX: bpo10
406406- PACKAGE_BRANCH: debian/buster-backports
407407- DISTRO: buster
408408-409409-debian:bullseye:package:
410410- extends:
411411- - .monado.variables.debian:bullseye
412412- - .fdo.distribution-image@debian # from ci-templates
413413- - .monado.base-job.debuild
414414- variables:
415415- BACKPORT_SUFFIX: bpo11
416416- PACKAGE_BRANCH: debian/bullseye
417417- DISTRO: bullseye
418418-419415ubuntu:focal:package:
420416 extends:
421421- - .monado.variables.ubuntu:focal
422422- - .fdo.distribution-image@ubuntu # from ci-templates
423423- - .monado.base-job.debuild
417417+ - .monado.image.ubuntu:focal
418418+ - .monado.packaging.conditions
424419 variables:
425425- BACKPORT_SUFFIX: ubuntu2004
426426- PACKAGE_BRANCH: ubuntu/focal
427427- DISTRO: focal
420420+ GIT_STRATEGY: clone
421421+ DEBFULLNAME: "Monado CI"
422422+ DEBEMAIL: "ryan.pavlik@collabora.com"
423423+ DISTRO: ubuntu
424424+ CODENAME: focal
425425+ DEB_VERSION_SUFFIX: ubuntu2004
426426+ stage: package
427427+ before_script:
428428+ - git config --global user.name Monado CI
429429+ - git config --global user.email ryan.pavlik@collabora.com
430430+ script:
431431+ # Prep the source tree
432432+ - git clean -dfx
433433+ # Call this script to build binary and source packages.
434434+ # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
435435+ - .gitlab-ci/build-and-submit-package.sh
436436+ artifacts:
437437+ paths:
438438+ - "incoming/"
439439+ expire_in: 2 days
428440429441ubuntu:hirsute:package:
430442 extends:
431431- - .monado.variables.ubuntu:hirsute
432432- - .fdo.distribution-image@ubuntu # from ci-templates
433433- - .monado.base-job.debuild
434434-443443+ - .monado.image.ubuntu:hirsute
444444+ - .monado.packaging.conditions
435445 variables:
436436- BACKPORT_SUFFIX: ubuntu2104
437437- PACKAGE_BRANCH: ubuntu/hirsute
438438- DISTRO: hirsute
446446+ GIT_STRATEGY: clone
447447+ DEBFULLNAME: "Monado CI"
448448+ DEBEMAIL: "ryan.pavlik@collabora.com"
449449+ DISTRO: ubuntu
450450+ CODENAME: hirsute
451451+ DEB_VERSION_SUFFIX: ubuntu2104
452452+ stage: package
453453+ before_script:
454454+ - git config --global user.name Monado CI
455455+ - git config --global user.email ryan.pavlik@collabora.com
456456+ script:
457457+ # Prep the source tree
458458+ - git clean -dfx
459459+ # Call this script to build binary and source packages.
460460+ # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
461461+ - .gitlab-ci/build-and-submit-package.sh
462462+ artifacts:
463463+ paths:
464464+ - "incoming/"
465465+ expire_in: 2 days
439466440467ubuntu:impish:package:
441468 extends:
442442- - .monado.variables.ubuntu:impish
443443- - .fdo.distribution-image@ubuntu # from ci-templates
444444- - .monado.base-job.debuild
445445-469469+ - .monado.image.ubuntu:impish
470470+ - .monado.packaging.conditions
446471 variables:
447447- BACKPORT_SUFFIX: ubuntu2110
448448- PACKAGE_BRANCH: ubuntu/impish
449449- DISTRO: impish
472472+ GIT_STRATEGY: clone
473473+ DEBFULLNAME: "Monado CI"
474474+ DEBEMAIL: "ryan.pavlik@collabora.com"
475475+ DISTRO: ubuntu
476476+ CODENAME: impish
477477+ DEB_VERSION_SUFFIX: ubuntu2110
478478+ stage: package
479479+ before_script:
480480+ - git config --global user.name Monado CI
481481+ - git config --global user.email ryan.pavlik@collabora.com
482482+ script:
483483+ # Prep the source tree
484484+ - git clean -dfx
485485+ # Call this script to build binary and source packages.
486486+ # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
487487+ - .gitlab-ci/build-and-submit-package.sh
488488+ artifacts:
489489+ paths:
490490+ - "incoming/"
491491+ expire_in: 2 days
450492451493reprepro:package:
452494 stage: reprepro
453495 extends:
454454- - .monado.variables.ubuntu:impish
455455- - .monado.packaging.conditions
456456- - .fdo.distribution-image@ubuntu # from ci-templates
496496+ - .monado.image.ubuntu:impish
497497+457498 dependencies:
458458- - debian:buster:package
459499 - debian:bullseye:package
460500 - ubuntu:focal:package
461501 - ubuntu:hirsute:package
462502 - ubuntu:impish:package
463463- before_script:
464464- # Convince gnupg to work properly in CI
465465- - mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
466466- - touch ~/.gnupg/gpg.conf
467467- - echo 'use-agent' > ~/.gnupg/gpg.conf
468468- - echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
469469- - touch ~/.gnupg/gpg-agent.conf
470470- - echo 'allow-loopback-pinentry' > ~/.gnupg/gpg-agent.conf
471471- - echo RELOADAGENT | gpg-connect-agent
472472- - gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE} --import ${MONADO_GPG_SECRET_KEY}
473473-474503 script:
475475- # Use reprepro to create an apt repository in our artifacts
476476- - mkdir -p repo/conf
477477- # For each distro, sign the changes file and add it to the repo.
478478- - |
479479- for fn in incoming/*.distro; do
480480- # parse the distro name out
481481- export DISTRO=$(echo $fn | sed -e 's:incoming/::' -e 's:[.]distro::')
482482- echo "Processing $DISTRO"
483483- # add distro to repository config - blank line is mandatory!
484484- cat .gitlab-ci/distributions | envsubst >> repo/conf/distributions
485485- echo >> repo/conf/distributions
486486-487487- echo "Signing package for $DISTRO"
488488- debsign -k ${MONADO_GPG_FINGERPRINT} -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" incoming/monado_$(cat $fn)_amd64.changes
489489-490490- echo "Adding package for $DISTRO to the repository"
491491- reprepro -V --ignore=wrongdistribution -b repo include ${DISTRO} incoming/monado_$(cat $fn)_amd64.changes
492492- done
504504+ - bash .gitlab-ci/reprepro.sh
493505 artifacts:
494506 paths:
495507 - "repo/"
···503515 only:
504516 - main
505517 dependencies:
506506- - debian:bullseye:cmake
518518+ - debian:cmake
507519 - reprepro:package
508520 script:
509521 - mkdir -p public
···511523 - mv repo public/apt
512524 artifacts:
513525 paths:
514514- - public
526526+ - public
-8
.gitlab-ci/arch_container_prep.sh
···11-#!/bin/sh
22-# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
33-# SPDX-License-Identifier: BSL-1.0
44-55-(
66- cd $(dirname $0)
77- bash ./build-openxr-openhmd.sh
88-)
+38
.gitlab-ci/build-and-submit-package.sh
···11+#!/usr/bin/env bash
22+# SPDX-License-Identifier: CC0-1.0
33+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
44+#
55+# Requires some environment variables (normally set by CI)
66+# Any extra args get passed to debuild, so try -B for a local binary-only build
77+88+set -euo pipefail
99+1010+echo "DISTRO ${DISTRO}"
1111+echo "CODENAME ${CODENAME}"
1212+echo "DEB_VERSION_SUFFIX ${DEB_VERSION_SUFFIX}"
1313+echo "CI_COMMIT_SHA ${CI_COMMIT_SHA}"
1414+1515+git remote update --prune
1616+1717+# Prep the source tree: grab the debian directory from the packaging branch.
1818+git checkout "origin/${DISTRO}/${CODENAME}" -- debian/
1919+datestamp=$(date --utc "+%Y%m%d")
2020+2121+2222+if [ ! "${CI_COMMIT_SHA}" ]; then
2323+ echo "Why don't I know what the commit hash is?"
2424+ exit 1
2525+fi
2626+2727+debian/extra/prepare-commit-package.sh "${CI_COMMIT_SHA}" "1~${DEB_VERSION_SUFFIX}~ci${datestamp}"
2828+# Build the package
2929+debuild -uc -us "$@"
3030+# Stash the package version in a convenient file for a later job.
3131+INCOMING="$(pwd)/incoming"
3232+export INCOMING
3333+mkdir -p "$INCOMING"
3434+dpkg-parsechangelog --show-field version > "incoming/${CODENAME}.distro"
3535+# Use dput-ng to move the package-related files into some artifacts.
3636+mkdir -p ~/.dput.d/profiles
3737+envsubst < .gitlab-ci/localhost.json > ~/.dput.d/profiles/localhost.json
3838+dput --debug localhost "../monado_$(dpkg-parsechangelog --show-field version)_amd64.changes"
-22
.gitlab-ci/build-openxr-openhmd.sh
···11-#!/bin/sh
22-# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
33-# SPDX-License-Identifier: BSL-1.0
44-55-# Install the OpenXR SDK, whatever version, installed system-wide.
66-git clone https://github.com/KhronosGroup/OpenXR-SDK
77-pushd OpenXR-SDK
88-mkdir build
99-pushd build
1010-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 ..
1111-ninja install
1212-popd
1313-popd
1414-1515-# Install OpenHMD from git master, as released versions are not sufficient
1616-# for us to build.
1717-git clone https://github.com/OpenHMD/OpenHMD
1818-pushd OpenHMD
1919-mkdir build
2020-meson --prefix=/usr/local --libdir=lib build
2121-ninja -C build install
2222-popd
+26
.gitlab-ci/ci-scripts.mk
···11+# SPDX-License-Identifier: CC0-1.0
22+# SPDX-FileCopyrightText: 2022 Collabora, Ltd. and the Monado contributors
33+#
44+# To generate all the templated files, run this from the root of the repo:
55+# make -f .gitlab-ci/ci-scripts.mk
66+77+# These also all have their template named the same with a .template suffix.
88+FILES_IN_SUBDIR := \
99+ .gitlab-ci/distributions \
1010+ .gitlab-ci/reprepro.sh \
1111+1212+CONFIG_FILE := .gitlab-ci/config.yml
1313+all: .gitlab-ci.yml $(FILES_IN_SUBDIR)
1414+.PHONY: all
1515+1616+clean:
1717+ rm -f .gitlab-ci.yml $(FILES_IN_SUBDIR)
1818+.PHONY: clean
1919+2020+# As the default thing for ci-fairy to template, this is special cased
2121+.gitlab-ci.yml: .gitlab-ci/ci.template $(CONFIG_FILE)
2222+ ci-fairy generate-template
2323+2424+# Everything else is structured alike
2525+$(FILES_IN_SUBDIR): %: %.jinja $(CONFIG_FILE)
2626+ ci-fairy generate-template --config=$(CONFIG_FILE) $< > $@
+254
.gitlab-ci/ci.template
···11+# SPDX-License-Identifier: CC0-1.0
22+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
33+44+{# ignore the warning, this is actually the template to edit. #}
55+######################################
66+# GENERATED - DO NOT EDIT #
77+# see .gitlab-ci/ci.template instead #
88+######################################
99+{#
1010+useful links:
1111+https://freedesktop.pages.freedesktop.org/ci-templates/
1212+https://freedesktop.pages.freedesktop.org/ci-templates/ci-fairy.html#templating-gitlab-ci-yml
1313+https://gitlab.freedesktop.org/freedesktop/ci-templates
1414+1515+Config file used for all templates: .gitlab-ci/config.yml
1616+.gitlab-ci.yml template: .gitlab-ci/ci.template
1717+.gitlab-ci/distributions template (for reprepro): .gitlab-ci/distributions.jinja
1818+.gitlab-ci/reprepro.sh template: .gitlab-ci/reprepro.sh.jinja
1919+2020+The following will update all files from templates:
2121+make -f .gitlab-ci/ci-scripts.mk
2222+#}
2323+2424+variables:
2525+ FDO_UPSTREAM_REPO: monado/monado
2626+2727+.templates_sha: &templates_sha {{fdo_ci_templates_sha}}
2828+2929+include:
3030+{% for distro in distributions %}
3131+ # {{ distro.name | capitalize }}
3232+ - project: "freedesktop/ci-templates"
3333+ ref: *templates_sha
3434+ file: "/templates/{{distro.name}}.yml"
3535+{% endfor %}
3636+3737+{% for distro in distributions -%} {%- for image in distro.images %}
3838+3939+# Variables for build and usage of {{ distro.name|capitalize }} {{image.codename}} image
4040+.monado.variables.{{distro.name}}:{{image.codename}}:
4141+ variables:
4242+ FDO_DISTRIBUTION_VERSION: "{{ image["distro_version"] | default(image.codename) }}"
4343+ FDO_DISTRIBUTION_TAG: "{{image["tag"]}}"
4444+{% if "repo_suffix" in image %}
4545+ FDO_REPO_SUFFIX: {{image["repo_suffix"]}}
4646+{% endif %}
4747+{% endfor -%} {%- endfor %}
4848+4949+stages:
5050+ - container_prep
5151+ - build
5252+ - package
5353+ - reprepro
5454+ - pages
5555+ - deploy
5656+5757+###
5858+# Container prep jobs
5959+6060+{%- for distro in distributions -%} {%- for image in distro.images %}
6161+6262+# Make {{ distro.name|capitalize }} {{image.codename}} image
6363+{{distro.name}}:{{image.codename}}:container_prep:
6464+ stage: container_prep
6565+ extends:
6666+ - .monado.variables.{{distro.name}}:{{image.codename}}
6767+ - .fdo.container-build@{{distro.name}} # from ci-templates
6868+ variables:
6969+ {# The packages list is actually a mapping, not an array, but the same syntax works. #}
7070+ {# Needed to be a mapping so it could be "merged" #}
7171+ FDO_DISTRIBUTION_PACKAGES: '{{image.packages | sort | join(" ")}}'
7272+{% if "script" in image %}
7373+ FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/{{image["script"]}}'
7474+{% endif %}
7575+{% endfor -%} {%- endfor %}
7676+7777+{# Macro to compute job name to extend to use image given distro and image objects#}
7878+{% macro base_job_to_use_image(distro, image) %}.monado.image.{{distro.name}}:{{image.codename}}{% endmacro -%}
7979+8080+###
8181+# Container usage base jobs
8282+{% for distro in distributions -%} {%- for image in distro.images %}
8383+8484+# Base for using {{ distro.name|capitalize }} {{image.codename}} image
8585+{{base_job_to_use_image(distro, image)}}:
8686+ extends:
8787+ - .monado.variables.{{distro.name}}:{{image.codename}}
8888+ - .fdo.{{ "suffixed" if "repo_suffix" in image else "distribution" }}-image@{{distro.name}} # from ci-templates
8989+9090+{% endfor -%} {%- endfor %}
9191+9292+{# Macro to compute job name to extend to use image given a package we want#}
9393+{% macro base_job_to_use_image_containing(package) %}
9494+{% for distro in distributions -%} {%- for image in distro.images if package in image.packages %}
9595+{{ base_job_to_use_image(distro, image) if loop.first }}
9696+{% endfor -%} {%- endfor %}
9797+{% endmacro -%}
9898+9999+# Style check job
100100+format-and-spellcheck:
101101+ extends:
102102+ - {{base_job_to_use_image_containing("codespell")}}
103103+ stage: build
104104+ script:
105105+ - scripts/format-and-spellcheck.sh
106106+ artifacts:
107107+ paths:
108108+ - patches/
109109+ expire_in: 1 week
110110+ when: on_failure
111111+112112+# Verify REUSE compliance
113113+reuse:
114114+ stage: build
115115+ image:
116116+ name: fsfe/reuse:latest
117117+ entrypoint: [""]
118118+ script:
119119+ - reuse lint
120120+121121+{% macro make_cmake_args(cmake_defines) %}
122122+{% if cmake_defines is defined %}
123123+{%- for k, v in cmake_defines |dictsort %} -D{{ k }}={{ v }}{% endfor %}
124124+{%- endif %}
125125+{%- endmacro -%}
126126+127127+{#### Main build jobs ####}
128128+{% for distro in distributions -%} {%- for image in distro.images if image.build_jobs -%} {%- for job in image.build_jobs %}
129129+130130+{{job.name}}:
131131+ stage: build
132132+ extends:
133133+ - {{base_job_to_use_image(distro, image)}}
134134+135135+{% if job.before_script %}
136136+ before_script:
137137+ {% for line in job.before_script %}
138138+ - {{line}}
139139+ {% endfor %}
140140+{% endif %}
141141+ script:
142142+ - rm -rf build
143143+144144+{#- meson builds -#}
145145+{%- if "meson" in job.name %}
146146+147147+ - meson setup build .
148148+ {%- if job.args %} {{ job.args | join(' ') }}{% endif %}
149149+150150+ - ninja -C build
151151+152152+{#- regular or NDK cmake builds -#}
153153+{%- elif "cmake" in job.name or "ndk" in job.name %}
154154+155155+ - cmake -GNinja -B build -S . {{- make_cmake_args(job.cmake_defines) }}
156156+ - echo "Build Options:"; grep "^XRT_" build/CMakeCache.txt
157157+ - ninja -C build
158158+159159+{%- else %}
160160+161161+{# error message #}
162162+ CANNOT GUESS JOB TYPE
163163+164164+{%- endif %}
165165+166166+{%- if "cmake" in job.name %}
167167+168168+ - cd build && ctest --output-on-failure
169169+{%- endif %}
170170+171171+{%- if job.artifact_path %}
172172+173173+ artifacts:
174174+ paths:
175175+ - {{ job.artifact_path }}
176176+{%- endif %}
177177+178178+{% endfor -%} {%- endfor -%} {%- endfor %}
179179+180180+# Packaging
181181+.monado.packaging.conditions:
182182+ rules:
183183+ # Only the default branch of the "upstream" repo.
184184+ - if: "$CI_PROJECT_PATH == $FDO_UPSTREAM_REPO && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
185185+ when: on_success
186186+ # Otherwise, don't build packages.
187187+ - when: never
188188+189189+{% macro packaging_job_name(distro, image) -%}
190190+{{distro.name}}:{{image.codename}}:package
191191+{%- endmacro %}
192192+193193+{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
194194+195195+{{packaging_job_name(distro, image)}}:
196196+ extends:
197197+ - {{base_job_to_use_image(distro, image)}}
198198+ - .monado.packaging.conditions
199199+ variables:
200200+ GIT_STRATEGY: clone
201201+ DEBFULLNAME: "{{packaging.name}}"
202202+ DEBEMAIL: "{{packaging.email}}"
203203+ DISTRO: {{distro.name}}
204204+ CODENAME: {{image.codename}}
205205+ DEB_VERSION_SUFFIX: {{image.deb_version_suffix}}
206206+ stage: package
207207+ before_script:
208208+ {# Configure git - needed despite not actually committing here. #}
209209+ - git config --global user.name {{packaging.name}}
210210+ - git config --global user.email {{packaging.email}}
211211+ script:
212212+ # Prep the source tree
213213+ - git clean -dfx
214214+ # Call this script to build binary and source packages.
215215+ # Can try locally by exporting the right variables and passing -B to get only a binary package to avoid complaints.
216216+ - .gitlab-ci/build-and-submit-package.sh
217217+ artifacts:
218218+ paths:
219219+ - "incoming/"
220220+ expire_in: 2 days
221221+{% endfor -%} {%- endfor %}
222222+223223+reprepro:package:
224224+ stage: reprepro
225225+ extends:
226226+ - {{ base_job_to_use_image_containing("reprepro") }}
227227+ dependencies:
228228+{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
229229+ - {{packaging_job_name(distro, image)}}
230230+{% endfor -%} {%- endfor %}
231231+ script:
232232+ - bash .gitlab-ci/reprepro.sh
233233+ artifacts:
234234+ paths:
235235+ - "repo/"
236236+ expire_in: 2 days
237237+238238+###
239239+# Pages
240240+###
241241+pages:
242242+ stage: pages
243243+ only:
244244+ - main
245245+ dependencies:
246246+ - debian:cmake
247247+ - reprepro:package
248248+ script:
249249+ - mkdir -p public
250250+ - mv build/doc/html/* public/
251251+ - mv repo public/apt
252252+ artifacts:
253253+ paths:
254254+ - public
+235
.gitlab-ci/config.yml
···11+# SPDX-License-Identifier: CC0-1.0
22+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
33+44+# Please run the following from the repo root after modifying this file:
55+# make -f .gitlab-ci/ci-scripts.mk
66+77+fdo_ci_templates_sha: 34039cd573a2df832d465bc9e4c5f543571f5241
88+99+# These are a mapping, instead of a list/array, so we can merge.
1010+.default_debian_packages:
1111+ &default_debian_packages # Packages required for build and some other basic jobs
1212+ build-essential:
1313+ git:
1414+ wget:
1515+ unzip:
1616+ cmake:
1717+ meson:
1818+ ninja-build:
1919+ libeigen3-dev:
2020+ curl:
2121+ patch:
2222+ python3:
2323+ pkg-config:
2424+ libx11-dev:
2525+ libx11-xcb-dev:
2626+ libxxf86vm-dev:
2727+ libxrandr-dev:
2828+ libxcb-randr0-dev:
2929+ libvulkan-dev:
3030+ glslang-tools:
3131+ libglvnd-dev:
3232+ libgl1-mesa-dev:
3333+ ca-certificates:
3434+ libusb-1.0-0-dev:
3535+ libudev-dev:
3636+ # These are optional packages, that we're building against to ensure we build as much code as possible
3737+ libhidapi-dev:
3838+ libwayland-dev:
3939+ libuvc-dev:
4040+ libavcodec-dev:
4141+ libopencv-dev:
4242+ libv4l-dev:
4343+ libcjson-dev:
4444+ libsdl2-dev:
4545+ libegl1-mesa-dev:
4646+ libdbus-1-dev:
4747+ libgstreamer1.0-dev:
4848+ libgstreamer-plugins-base1.0-dev:
4949+ libsystemd-dev:
5050+ libbsd-dev:
5151+ # Only used for building packages
5252+ devscripts:
5353+ debhelper:
5454+ dput-ng:
5555+ gettext-base:
5656+ pandoc:
5757+5858+# These config defines are used for all NDK builds
5959+.android_cmake_defines: &android_cmake_defines
6060+ ANDROID_PLATFORM: 26
6161+ CMAKE_TOOLCHAIN_FILE: /opt/android-ndk/build/cmake/android.toolchain.cmake
6262+ Eigen3_DIR: /usr/lib/cmake/eigen3/
6363+ EIGEN3_INCLUDE_DIR: /usr/include/eigen3
6464+6565+# The distributions we'll make an image for
6666+distributions:
6767+ - name: debian
6868+ images:
6969+ # This image does some extra work.
7070+ - codename: bullseye
7171+ script: i386_and_proclamation_container_prep.sh
7272+ tag: "2022-01-24.0"
7373+ deb_version_suffix: bpo11
7474+ packages:
7575+ <<: *default_debian_packages
7676+ codespell:
7777+ doxygen:
7878+ graphviz:
7979+ python3-pip:
8080+ python3-click:
8181+ clang-format:
8282+ build_jobs:
8383+ - name: "debian:cmake"
8484+ # Generate "changes since last release" and add to changelog,
8585+ # since this is the build that makes our docs.
8686+ before_script:
8787+ - pushd doc/changes
8888+ - proclamation build --overwrite vNEXT
8989+ - popd
9090+ artifact_path: build/doc/html/
9191+9292+ - name: "debian:cmake-no-opencv"
9393+ cmake_defines:
9494+ BUILD_DOC: "OFF"
9595+ XRT_HAVE_OPENCV: "OFF"
9696+9797+ - name: "debian:cmake-no-sdl2"
9898+ cmake_defines:
9999+ BUILD_DOC: "OFF"
100100+ XRT_HAVE_SDL2: "OFF"
101101+102102+ - name: "debian:cmake-no-service"
103103+ cmake_defines:
104104+ BUILD_DOC: "OFF"
105105+ XRT_FEATURE_SERVICE: "OFF"
106106+107107+ - name: "debian:cmake:32bit"
108108+ cmake_defines:
109109+ CMAKE_TOOLCHAIN_FILE: .gitlab-ci/i386.cmake
110110+ # OpenCV doesn't play nicely with us in multi-arch.
111111+ XRT_HAVE_OPENCV: "OFF"
112112+113113+ - name: "debian:meson"
114114+115115+ - name: "debian:meson:32bit"
116116+ args:
117117+ - --prefix=/usr
118118+ - --libdir=/usr/lib/i386-linux-gnu
119119+ - --cross-file=.gitlab-ci/i386-cross.txt
120120+121121+ # This one is pretty minimal, compared to the others.
122122+ - codename: bullseye-ndk
123123+ distro_version: bullseye
124124+ repo_suffix: ndk
125125+ script: ndk_container_prep.sh
126126+ tag: "2022-01-24.0"
127127+ packages:
128128+ git:
129129+ wget:
130130+ unzip:
131131+ cmake:
132132+ meson:
133133+ ninja-build:
134134+ libeigen3-dev:
135135+ python3:
136136+ pkg-config:
137137+ ca-certificates:
138138+ glslang-tools:
139139+ build_jobs:
140140+ - name: "ndk:armeabi-v7a"
141141+ cmake_defines:
142142+ <<: *android_cmake_defines
143143+ BUILD_DOC: "OFF"
144144+ ANDROID_ABI: armeabi-v7a
145145+146146+ - name: "ndk:arm64-v8a"
147147+ cmake_defines:
148148+ <<: *android_cmake_defines
149149+ BUILD_DOC: "OFF"
150150+ ANDROID_ABI: arm64-v8a
151151+152152+ - name: ubuntu
153153+ images:
154154+ # LTS
155155+ - codename: focal
156156+ distro_version: "20.04"
157157+ tag: "2022-01-24.0"
158158+ deb_version_suffix: ubuntu2004
159159+ packages:
160160+ <<: *default_debian_packages
161161+ build_jobs:
162162+ - name: "ubuntu:cmake"
163163+ cmake_defines:
164164+ BUILD_DOC: "OFF"
165165+166166+ - name: "ubuntu:meson"
167167+168168+ - codename: hirsute
169169+ distro_version: "21.04"
170170+ tag: "2022-01-24.0"
171171+ deb_version_suffix: ubuntu2104
172172+ packages:
173173+ <<: *default_debian_packages
174174+175175+ - codename: impish
176176+ distro_version: "21.10"
177177+ tag: "2022-01-24.0"
178178+ deb_version_suffix: ubuntu2110
179179+ packages:
180180+ <<: *default_debian_packages
181181+ reprepro:
182182+ build_jobs:
183183+ - name: "ubuntu:latest:cmake"
184184+ cmake_defines:
185185+ BUILD_DOC: "OFF"
186186+187187+ - name: arch
188188+ images:
189189+ - codename: rolling
190190+ tag: "2022-01-24.0"
191191+ packages:
192192+ git:
193193+ gcc:
194194+ clang:
195195+ cmake:
196196+ meson:
197197+ ninja:
198198+ pkgconfig:
199199+ python3:
200200+ diffutils:
201201+ patch:
202202+ doxygen:
203203+ graphviz:
204204+ eigen:
205205+ hidapi:
206206+ libxrandr:
207207+ mesa:
208208+ glslang:
209209+ vulkan-headers:
210210+ vulkan-icd-loader:
211211+ check:
212212+ glfw-x11:
213213+ libusb:
214214+ opencv:
215215+ gtk3:
216216+ ffmpeg:
217217+ v4l-utils:
218218+ qt5-base:
219219+ build_jobs:
220220+ - name: "arch:cmake"
221221+222222+ - name: "arch:cmake:clang"
223223+ cmake_defines:
224224+ CMAKE_C_COMPILER: /usr/bin/clang
225225+ CMAKE_CXX_COMPILER: /usr/bin/clang++
226226+227227+ - name: "arch:meson"
228228+229229+android:
230230+ platform: 26
231231+232232+packaging:
233233+ # Name and email associated with the package
234234+ name: "Monado CI"
235235+ email: "ryan.pavlik@collabora.com"
···11-#!/bin/bash
22-# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
33-# SPDX-License-Identifier: BSL-1.0
44-55-(
66- cd $(dirname $0)
77- bash ./install-cross.sh
88-)
99-(
1010- cd $(dirname $0)
1111- bash ./build-openxr-openhmd.sh
1212-)
+26-1
.gitlab-ci/distributions
···11Origin: monado.freedesktop.org
22Description: Monado CI apt repository
33-Codename: ${DISTRO}
33+Codename: bullseye
44+Architectures: amd64 i386 source
55+Components: main
66+Tracking: minimal
77+SignWith: ${MONADO_GPG_FINGERPRINT}
88+99+Origin: monado.freedesktop.org
1010+Description: Monado CI apt repository
1111+Codename: focal
1212+Architectures: amd64 i386 source
1313+Components: main
1414+Tracking: minimal
1515+SignWith: ${MONADO_GPG_FINGERPRINT}
1616+1717+Origin: monado.freedesktop.org
1818+Description: Monado CI apt repository
1919+Codename: hirsute
2020+Architectures: amd64 i386 source
2121+Components: main
2222+Tracking: minimal
2323+SignWith: ${MONADO_GPG_FINGERPRINT}
2424+2525+Origin: monado.freedesktop.org
2626+Description: Monado CI apt repository
2727+Codename: impish
428Architectures: amd64 i386 source
529Components: main
630Tracking: minimal
731SignWith: ${MONADO_GPG_FINGERPRINT}
3232+
+33
.gitlab-ci/distributions.jinja
···11+{#
22+Copyright 2020-2022, Collabora, Ltd.
33+44+SPDX-License-Identifier: BSL-1.0
55+#}
66+{#
77+Template for reprepro distributions config file.
88+99+After this template gets expanded, with a paragraph for each
1010+distribution codename supported,
1111+the GPG fingerprint gets substituted into that at CI time using envsubst,
1212+(not ahead of time using ci-fairy)
1313+because the fingerprint is included in the "secrets" in CI.
1414+1515+Note: There is no way to indicate comments in the reprepro distributions config
1616+file format, and whitespace is meaningful (need blank lines between paragraphs).
1717+1818+Please run the following after modifying this file:
1919+2020+ ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/distributions.jinja > .gitlab-ci/distributions
2121+2222+or just use the makefile.
2323+#}
2424+{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
2525+Origin: monado.freedesktop.org
2626+Description: Monado CI apt repository
2727+Codename: {{ image.codename }}
2828+Architectures: amd64 i386 source
2929+Components: main
3030+Tracking: minimal
3131+SignWith: ${MONADO_GPG_FINGERPRINT}
3232+3333+{% endfor -%} {%- endfor %}
+4-2
.gitlab-ci/distributions.license
···11-Copyright 2020, Collabora, Ltd.
11+Copyright 2020-2022, Collabora, Ltd.
2233-SPDX-License-Identifier: BSL-1.033+SPDX-License-Identifier: BSL-1.0
44+55+Generated from distributions.jinja with ci-fairy
+5
.gitlab-ci/gpg-agent.conf
···11+# SPDX-License-Identifier: CC0-1.0
22+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
33+44+# Used for CI package building.
55+allow-loopback-pinentry
+6
.gitlab-ci/gpg.conf
···11+# SPDX-License-Identifier: CC0-1.0
22+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
33+44+# Used for CI package building.
55+use-agent
66+pinentry-mode loopback
+71
.gitlab-ci/reprepro.sh
···11+#!/usr/bin/env bash
22+# SPDX-License-Identifier: CC0-1.0
33+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
44+55+###############################################
66+# GENERATED - DO NOT EDIT #
77+# see .gitlab-ci/reprepro.sh.template instead #
88+###############################################
99+1010+1111+set -euo pipefail
1212+1313+# Convince gnupg to work properly in CI
1414+echo "Import and cache the GPG key"
1515+mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
1616+cp .gitlab-ci/gpg.conf .gitlab-ci/gpg-agent.conf ~/.gnupg
1717+echo RELOADAGENT | gpg-connect-agent
1818+gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase "${MONADO_GPG_PASSPHRASE}" --import "${MONADO_GPG_SECRET_KEY}"
1919+2020+echo "Prepare reprepro config"
2121+mkdir -p repo/conf
2222+# Substitute in the GPG fingerprint into the repository config.
2323+# This file is itself generated with ci-fairy.
2424+cat .gitlab-ci/distributions | envsubst > repo/conf/distributions
2525+2626+echo "reprepro config file:"
2727+echo "---------------------"
2828+cat repo/conf/distributions
2929+echo "---------------------"
3030+3131+# For each distro, sign the changes file and add it to the repo.
3232+3333+# bullseye
3434+if [ -f "incoming/bullseye.distro" ]; then
3535+ VERSION=$(cat incoming/bullseye.distro)
3636+ echo "Signing and processing bullseye: ${VERSION}"
3737+ debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
3838+ reprepro -V --ignore=wrongdistribution -b repo include bullseye "incoming/monado_${VERSION}_amd64.changes"
3939+else
4040+ echo "Skipping bullseye - no artifact found"
4141+fi
4242+4343+# focal
4444+if [ -f "incoming/focal.distro" ]; then
4545+ VERSION=$(cat incoming/focal.distro)
4646+ echo "Signing and processing focal: ${VERSION}"
4747+ debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
4848+ reprepro -V --ignore=wrongdistribution -b repo include focal "incoming/monado_${VERSION}_amd64.changes"
4949+else
5050+ echo "Skipping focal - no artifact found"
5151+fi
5252+5353+# hirsute
5454+if [ -f "incoming/hirsute.distro" ]; then
5555+ VERSION=$(cat incoming/hirsute.distro)
5656+ echo "Signing and processing hirsute: ${VERSION}"
5757+ debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
5858+ reprepro -V --ignore=wrongdistribution -b repo include hirsute "incoming/monado_${VERSION}_amd64.changes"
5959+else
6060+ echo "Skipping hirsute - no artifact found"
6161+fi
6262+6363+# impish
6464+if [ -f "incoming/impish.distro" ]; then
6565+ VERSION=$(cat incoming/impish.distro)
6666+ echo "Signing and processing impish: ${VERSION}"
6767+ debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
6868+ reprepro -V --ignore=wrongdistribution -b repo include impish "incoming/monado_${VERSION}_amd64.changes"
6969+else
7070+ echo "Skipping impish - no artifact found"
7171+fi
+48
.gitlab-ci/reprepro.sh.jinja
···11+#!/usr/bin/env bash
22+# SPDX-License-Identifier: CC0-1.0
33+# SPDX-FileCopyrightText: 2018-2022 Collabora, Ltd. and the Monado contributors
44+55+{# ignore the warning, this is actually the template to edit. #}
66+###############################################
77+# GENERATED - DO NOT EDIT #
88+# see .gitlab-ci/reprepro.sh.template instead #
99+###############################################
1010+{#
1111+Please run the following after editing:
1212+ ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/reprepro.sh.template > .gitlab-ci/reprepro.sh
1313+#}
1414+1515+1616+set -euo pipefail
1717+1818+# Convince gnupg to work properly in CI
1919+echo "Import and cache the GPG key"
2020+mkdir -p ~/.gnupg && chmod 700 ~/.gnupg
2121+cp .gitlab-ci/gpg.conf .gitlab-ci/gpg-agent.conf ~/.gnupg
2222+echo RELOADAGENT | gpg-connect-agent
2323+gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase "${MONADO_GPG_PASSPHRASE}" --import "${MONADO_GPG_SECRET_KEY}"
2424+2525+echo "Prepare reprepro config"
2626+mkdir -p repo/conf
2727+# Substitute in the GPG fingerprint into the repository config.
2828+# This file is itself generated with ci-fairy.
2929+cat .gitlab-ci/distributions | envsubst > repo/conf/distributions
3030+3131+echo "reprepro config file:"
3232+echo "---------------------"
3333+cat repo/conf/distributions
3434+echo "---------------------"
3535+3636+# For each distro, sign the changes file and add it to the repo.
3737+{% for distro in distributions -%} {%- for image in distro.images if "deb_version_suffix" in image %}
3838+3939+# {{ image.codename }}
4040+if [ -f "incoming/{{image.codename}}.distro" ]; then
4141+ VERSION=$(cat incoming/{{image.codename}}.distro)
4242+ echo "Signing and processing {{image.codename}}: ${VERSION}"
4343+ debsign -k "${MONADO_GPG_FINGERPRINT}" -p "gpg --batch --no-tty --yes --pinentry-mode loopback --passphrase ${MONADO_GPG_PASSPHRASE}" "incoming/monado_${VERSION}_amd64.changes"
4444+ reprepro -V --ignore=wrongdistribution -b repo include {{image.codename}} "incoming/monado_${VERSION}_amd64.changes"
4545+else
4646+ echo "Skipping {{image.codename}} - no artifact found"
4747+fi
4848+{% endfor -%} {%- endfor %}
-7
.gitlab-ci/ubuntu_focal_container_prep.sh
···11-#!/bin/bash
22-# Copyright 2018-2020, Collabora, Ltd. and the Monado contributors
33-# SPDX-License-Identifier: BSL-1.0
44-(
55- cd $(dirname $0)
66- bash ./build-openxr-openhmd.sh
77-)
-5
.gitlab-ci/ubuntu_hirsute_container_prep.sh
···11-#!/bin/bash
22-# Copyright 2021, Collabora, Ltd. and the Monado contributors
33-# SPDX-License-Identifier: BSL-1.0
44-55-# Nothing really needed.
-5
.gitlab-ci/ubuntu_impish_container_prep.sh
···11-#!/bin/bash
22-# Copyright 2021, Collabora, Ltd. and the Monado contributors
33-# SPDX-License-Identifier: BSL-1.0
44-55-# Nothing really needed.