monado/.gitlab-ci.yml

271 lines
8.1 KiB
YAML
Raw Normal View History

2020-03-18 16:42:27 +00:00
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: 2018-2020 Collabora, Ltd. and the Monado contributors
variables:
FDO_UPSTREAM_REPO: monado/monado
2019-04-09 16:07:14 +00:00
.templates_sha: &templates_sha 322bf2b8f29b6491caeb13861201e96969ddc169
# Variables listing packages for Debian-based distros
.monado.debian-based-packages:
variables:
CORE_REQUIRED_PACKAGES: "build-essential git wget unzip cmake meson ninja-build libeigen3-dev curl patch python3 pkg-config libx11-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"
FEATURE_PACKAGES: "libhidapi-dev libwayland-dev libuvc-dev libavcodec-dev libopencv-dev libv4l-dev libcjson-dev libsdl2-dev libegl1-mesa-dev"
PACKAGING_PACKAGES: "devscripts debhelper osc osc-plugins-dput"
TOOLS_REQUIRED_PACKAGES: "clang-format-7 codespell doxygen graphviz python3-pip python3-click"
# Variables for build and usage of Debian 10 (Buster) image
.monado.debian:buster:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_TAG: "2020-05-06.1"
2020-04-28 16:48:59 +00:00
# Variables for build and usage of Debian 10 (Buster) + Android NDK image
.monado.debian:buster-ndk:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_TAG: "2020-05-06.0"
2020-04-28 16:48:59 +00:00
FDO_REPO_SUFFIX: ndk
# Variables for build and usage of Arch Linux image
.monado.arch:rolling:
variables:
FDO_DISTRIBUTION_TAG: "2019-04-28.0"
include:
- project: "freedesktop/ci-templates"
ref: *templates_sha
2020-03-23 20:33:57 +00:00
file: "/templates/debian.yml"
- project: "freedesktop/ci-templates"
ref: *templates_sha
2020-03-23 20:33:57 +00:00
file: "/templates/arch.yml"
stages:
- container_prep
- build
- package
2019-08-23 14:42:41 +00:00
- pages
- deploy
###
# Container prep jobs
# Base for all container prep
.monado.container_base:
# "stage" set here doesn't work, for some reason
variables:
# no need to pull the whole tree for rebuilding the image - is this still needed?
GIT_STRATEGY: none
# Each most-derived job has a script to set up stuff for it.
FDO_DISTRIBUTION_EXEC: "bash .gitlab-ci/${CI_JOB_NAME}.sh"
2020-04-27 22:50:56 +00:00
# Debian Buster (x64 + i386)
2019-04-09 16:07:14 +00:00
debian:container_prep:
stage: container_prep
extends:
- .monado.debian:buster # local - variables
- .monado.container_base # local
- .monado.debian-based-packages # local - variables
- .fdo.container-build@debian # from ci-templates
2019-12-03 15:15:33 +00:00
variables:
# a list of packages to install - assembled from .monado.debian-based-packages
FDO_DISTRIBUTION_PACKAGES: "${CORE_REQUIRED_PACKAGES} ${FEATURE_PACKAGES} ${PACKAGING_PACKAGES} ${TOOLS_REQUIRED_PACKAGES}"
# Arch Linux (x64)
2019-04-09 16:07:14 +00:00
arch:container_prep:
stage: container_prep
extends:
- .monado.arch:rolling # local
- .monado.container_base # local
- .fdo.container-build@arch # from ci-templates
2019-12-03 15:15:33 +00:00
variables:
# a list of packages to install
FDO_DISTRIBUTION_PACKAGES: "git gcc 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"
2019-04-09 16:07:14 +00:00
2020-04-28 16:48:59 +00:00
# Debian Buster + the Android NDK in /opt/android-ndk
# The NDK itself gets installed by .gitlab-ci/ndk:container_prep.sh
ndk:container_prep:
stage: container_prep
extends:
- .monado.debian:buster-ndk # local
- .monado.container_base # local
- .fdo.container-build@debian # from ci-templates
variables:
# Repo suffix is set in .monado.debian:buster-ndk
# a list of packages to install
FDO_DISTRIBUTION_PACKAGES: "git wget unzip cmake meson ninja-build libeigen3-dev python3 pkg-config ca-certificates glslang-tools"
format-and-spellcheck:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
stage: build
script:
2020-03-23 20:33:57 +00:00
- scripts/format-and-spellcheck.sh
artifacts:
paths:
- patches/
expire_in: 1 week
when: on_failure
# "Base" job for a CMake build
.monado.build-cmake:
2019-04-09 16:07:14 +00:00
stage: build
script:
2020-03-23 20:33:57 +00:00
- mkdir build
- pushd build
- cmake -GNinja .. $CMAKE_ARGS
2020-03-23 20:33:57 +00:00
- ninja
2019-09-24 14:13:11 +00:00
# "Base" job for a Meson build
.monado.build-meson:
2019-09-24 14:13:11 +00:00
stage: build
script:
2020-03-23 20:33:57 +00:00
- mkdir build
- pushd build
- meson .. $MESON_ARGS
2020-03-23 20:33:57 +00:00
- ninja
2019-09-24 14:13:11 +00:00
debian:cmake:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-cmake # local
before_script:
# Generate "changes since last release" and add to changelog,
# since this is the build that makes our docs.
2020-03-23 20:33:57 +00:00
- pip3 install proclamation
- pushd doc/changes
- proclamation build --overwrite vNEXT
- popd
artifacts:
paths:
- build/doc/html/
2019-04-09 16:07:14 +00:00
debian:cmake-no-opencv:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-cmake # local
variables:
CMAKE_ARGS: -DBUILD_WITH_OPENCV=OFF
debian:cmake-no-opengl:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-cmake # local
variables:
CMAKE_ARGS: -DBUILD_WITH_OPENGL=OFF
debian:cmake-no-sdl2:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-cmake # local
variables:
CMAKE_ARGS: -DBUILD_WITH_SDL2=OFF
arch:cmake:
extends:
- .monado.arch:rolling # local
- .fdo.distribution-image@arch # from ci-templates
- .monado.build-cmake # local
debian:meson:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-meson # local
arch:meson:
extends:
- .monado.arch:rolling # local
- .fdo.distribution-image@arch # from ci-templates
- .monado.build-meson # local
variables:
MESON_ARGS: -Ddocs=disabled
2020-04-27 22:50:56 +00:00
# Cross-compiling
debian:meson:32bit:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-meson # local
variables:
MESON_ARGS: --prefix /usr --libdir /usr/lib/i386-linux-gnu --cross-file ../.gitlab-ci/i386-cross.txt
debian:cmake:32bit:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
- .monado.build-cmake # local
variables:
# OpenCV and local OpenHMD doesn't play nicely with us in multi-arch.
CMAKE_ARGS: -DCMAKE_TOOLCHAIN_FILE=../.gitlab-ci/i386.cmake -DBUILD_WITH_OPENCV=off -DBUILD_WITH_OPENHMD=off
# Packaging
debian:buster:package:
stage: build
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
only:
- ci-packaging
variables:
BACKPORT_SUFFIX: bpo10
PACKAGE_BRANCH: debian/buster-backports
script:
- git config --global user.email "ryan.pavlik@collabora.com"
- git config --global user.name "Monado CI"
- git merge origin/${PACKAGE_BRANCH} --no-commit
- FULLNAME="Monado CI <ryan.pavlik@collabora.com>" debian/extra/prepare-commit-package.sh ${CI_COMMIT_SHA} 1~${BACKPORT_SUFFIX}~ci$(date --utc "+%Y%m%d")
- debuild -uc -us
- cp ../*.deb .
artifacts:
paths:
- "*.deb"
expire_in: 30 days
2020-04-28 16:48:59 +00:00
# Base of Android NDK builds.
# Takes the last :-delimited part of the name as the ABI to build for,
# so you don't need to do anything other than "extends" in the job
.monado.ndk:build-base:
stage: build
extends:
- .monado.debian:buster-ndk # local
- .fdo.suffixed-image@debian # from ci-templates
variables:
ANDROID_PLATFORM: 24
script:
- mkdir build
- pushd build
# This extracts the ABI from the job name
- export ABI=$(echo $CI_JOB_NAME | cut --delimiter=":" -f 2)
# Note we are pointing CMake to the host install of Eigen3 because it's header-only
# and thus this is safe to do.
- 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/
- ninja
ndk:armeabi-v7a:
extends: .monado.ndk:build-base
ndk:arm64-v8a:
extends: .monado.ndk:build-base
###
# Pages
###
pages:
2019-08-23 14:42:41 +00:00
stage: pages
only:
- master
dependencies:
- debian:cmake
script:
2019-09-22 14:59:17 +00:00
- mkdir -p public
- mv build/doc/html/* public/
artifacts:
paths:
- public