ci: Re-organize and port to the new fdo templates.

This commit is contained in:
Ryan Pavlik 2020-04-27 17:49:46 -05:00 committed by Jakob Bornecrantz
parent cb3096128a
commit cc8dbb4f2f
3 changed files with 100 additions and 46 deletions

View file

@ -2,21 +2,36 @@
# SPDX-FileCopyrightText: 2018-2020 Collabora, Ltd. and the Monado contributors # SPDX-FileCopyrightText: 2018-2020 Collabora, Ltd. and the Monado contributors
variables: variables:
UPSTREAM_REPO: monado/monado FDO_UPSTREAM_REPO: monado/monado
DEBIAN_TAG: 2019-03-23.0 DEBIAN_TAG: 2019-04-27.0
DEBIAN_VERSION: buster DEBIAN_VERSION: buster
DEBIAN_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG" DEBIAN_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/debian/$DEBIAN_VERSION:$DEBIAN_TAG"
NDK_TAG: 2020-04-27.0
NDK_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/debian/ndk:$NDK_TAG"
ARCH_TAG: 2019-12-03.0 ARCH_TAG: 2019-12-03.0
ARCH_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/archlinux/rolling:$ARCH_TAG" ARCH_CONTAINER_IMAGE: "$CI_REGISTRY_IMAGE/archlinux/rolling:$ARCH_TAG"
.templates_sha: &templates_sha 322bf2b8f29b6491caeb13861201e96969ddc169
# Variables for build and usage of Debian 10 (Buster) image
.monado.debian:buster:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_TAG: "2019-04-28.0"
# Variables for build and usage of Arch Linux image
.monado.arch:rolling:
variables:
FDO_DISTRIBUTION_TAG: "2019-04-28.0"
include: include:
- project: "wayland/ci-templates" - project: "freedesktop/ci-templates"
ref: 0a9bdd33a98f05af6761ab118b5074952242aab0 ref: *templates_sha
file: "/templates/debian.yml" file: "/templates/debian.yml"
- project: "wayland/ci-templates" - project: "freedesktop/ci-templates"
ref: 0a9bdd33a98f05af6761ab118b5074952242aab0 ref: *templates_sha
file: "/templates/arch.yml" file: "/templates/arch.yml"
stages: stages:
@ -25,27 +40,45 @@ stages:
- pages - pages
- deploy - deploy
debian:container_prep: ###
extends: .debian@container-ifnot-exists # Container prep jobs
stage: container_prep
variables:
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
# a list of packages to install
DEBIAN_DEBS: "build-essential git cmake meson ninja-build doxygen graphviz libeigen3-dev curl patch python3 pkg-config libx11-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libhidapi-dev libwayland-dev libvulkan-dev glslang-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libuvc-dev libavcodec-dev libopencv-dev libudev-dev clang-format-7 codespell libv4l-dev libegl1-mesa-dev python3-click python3-pip"
DEBIAN_EXEC: "bash .gitlab-ci/build-openxr-openhmd.sh"
arch:container_prep: # Base for all container prep
extends: .arch@container-ifnot-exists .monado.container_base:
stage: container_prep # "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"
# Debian Buster (x64)
debian:container_prep:
stage: container_prep
extends:
- .monado.debian:buster # local
- .monado.container_base # local
- .fdo.container-build@debian # from ci-templates
variables: variables:
GIT_STRATEGY: none # no need to pull the whole tree for rebuilding the image
# a list of packages to install # a list of packages to install
ARCH_PKGS: "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" FDO_DISTRIBUTION_PACKAGES: "build-essential git wget unzip cmake meson ninja-build doxygen graphviz libeigen3-dev curl patch python3 pkg-config libx11-dev libxxf86vm-dev libxrandr-dev libxcb-randr0-dev libhidapi-dev libwayland-dev libvulkan-dev glslang-dev glslang-tools libglvnd-dev libgl1-mesa-dev ca-certificates libusb-1.0-0-dev libuvc-dev libavcodec-dev libopencv-dev libudev-dev clang-format-7 codespell libv4l-dev libegl1-mesa-dev python3-pip python3-click"
ARCH_EXEC: "bash .gitlab-ci/build-openxr-openhmd.sh"
# Arch Linux (x64)
arch:container_prep:
stage: container_prep
extends:
- .monado.arch:rolling # local
- .monado.container_base # local
- .fdo.container-build@arch # from ci-templates
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"
format-and-spellcheck: format-and-spellcheck:
extends:
- .monado.debian:buster # local
- .fdo.distribution-image@debian # from ci-templates
stage: build stage: build
image: $DEBIAN_CONTAINER_IMAGE
script: script:
- scripts/format-and-spellcheck.sh - scripts/format-and-spellcheck.sh
artifacts: artifacts:
@ -54,50 +87,59 @@ format-and-spellcheck:
expire_in: 1 week expire_in: 1 week
when: on_failure when: on_failure
debian:build-cmake: # "Base" job for a CMake build
.monado.build-cmake:
stage: build stage: build
image: $DEBIAN_CONTAINER_IMAGE
script: script:
- mkdir build - mkdir build
- pushd build - pushd build
- cmake -GNinja .. - cmake -GNinja .. $CMAKE_ARGS
- ninja - ninja
arch:build-cmake: # "Base" job for a Meson build
.monado.build-meson:
stage: build stage: build
image: $ARCH_CONTAINER_IMAGE
script: script:
- mkdir build - mkdir build
- pushd build - pushd build
- cmake -GNinja .. - meson .. $MESON_ARGS
- ninja - ninja
debian:build-meson: debian:cmake:
stage: build extends:
image: $DEBIAN_CONTAINER_IMAGE - .monado.debian:buster # local
script: - .fdo.distribution-image@debian # from ci-templates
# Generate "changes since last release" - .monado.build-cmake # local
before_script:
# Generate "changes since last release" and add to changelog,
# since this is the build that makes our docs.
- pip3 install proclamation - pip3 install proclamation
- pushd doc/changes - pushd doc/changes
- proclamation build --overwrite vNEXT - proclamation build --overwrite vNEXT
- popd - popd
# Now proceed with build.
- mkdir build
- pushd build
- meson ..
- ninja
artifacts: artifacts:
paths: paths:
- build/doc/html/ - build/doc/html/
arch:build-meson: arch:cmake:
stage: build extends:
image: $ARCH_CONTAINER_IMAGE - .monado.arch:rolling # local
script: - .fdo.distribution-image@arch # from ci-templates
- mkdir build - .monado.build-cmake # local
- pushd build
- meson -Ddocs=disabled .. debian:meson:
- ninja 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
### ###
# Pages # Pages
@ -107,7 +149,7 @@ pages:
only: only:
- master - master
dependencies: dependencies:
- debian:build-meson - debian:cmake
script: script:
- mkdir -p public - mkdir -p public
- mv build/doc/html/* public/ - mv build/doc/html/* public/

View file

@ -0,0 +1,6 @@
#!/bin/sh
(
cd $(dirname $0)
bash ./build-openxr-openhmd.sh
)

View file

@ -0,0 +1,6 @@
#!/bin/bash
(
cd $(dirname $0)
bash ./build-openxr-openhmd.sh
)