From 7e741ef98387024ab7094b7d168df02d272720bd Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 14 Apr 2021 10:21:58 +1000 Subject: [PATCH] ci: add build jobs for automatic and custom-tailored options Simple jobs that run a standard meson build process, once with no options selected, once with a matrix of various options explicitly enabled or disabled. This should pick up any accidental build errors. The CI_JOB_NAME now includes brackets which cause issues in file paths, so we use the CI_JOB_ID instead as build dir. --- .gitlab-ci.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 58a8a4049..c913771fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -73,7 +73,7 @@ include: .build: before_script: # setup the environment - - export BUILD_ID="$CI_JOB_NAME" + - export BUILD_ID="$CI_JOB_ID" - export PREFIX="$PWD/prefix-$BUILD_ID" - export BUILD_DIR="$PWD/build-$BUILD_ID" - export XDG_RUNTIME_DIR="$(mktemp -p $PWD -d xdg-runtime-XXXXXX)" @@ -129,6 +129,28 @@ build_on_fedora: -Dsdl2=enabled -Dsndfile=enabled +# build with all options on auto() or their default values +build_with_no_commandline_options: + extends: + - build_on_fedora + variables: + MESON_OPTIONS: "" + +# build with a set of options enabled or disabled +build_with_custom_options: + extends: + - build_on_fedora + parallel: + matrix: + - MESON_OPTION: [docs, installed_tests, systemd-system-service, bluez5-backend-hsphfpd, + audiotestsrc, test, videotestsrc, volume, vulkan, sdl2, sndfile] + MESON_OPTION_VALUE: [enabled, disabled] + script: + - echo "Building with -D$MESON_OPTION=$MESON_OPTION_VALUE" + - meson "$BUILD_DIR" . --prefix="$PREFIX" "-D$MESON_OPTION=$MESON_OPTION_VALUE" + - ninja -C "$BUILD_DIR" + - ninja -C "$BUILD_DIR" test + build_with_coverity: extends: - .fedora