From 38bb83e91427756dbc4bc37c52a465e9e360030c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 9 Apr 2021 15:33:32 +0100 Subject: Don't run sanity checks by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sanity check scripts verify that the binding covers all APIs in the libvirt library/headers being built against. This is primarily there for libvirt maintainers to identify when there are gaps in API coverage. This is not something downstream consumers of libvirt-python should be running themselves, so we shouldn't added it to tests by default. In addition if people are working on branches or submitting merge requests for python changes, we shouldn't block their work for failed API coverage sanity tests, if the python binding otherwise builds fine and passes regular unit tests. Thus, we introduce a new gitlab job "api-coverage" with some conditions: - If pushing to a branch, the job is treated as non-fatal - For regular scheduled builds, it is mandatory - Don't run in any other scenarios This job uses the artifacts from the centos-8-git-build job and re-runs the test suite, requesting the sanity tests to be run too. This will achieve the result of letting us see missing API coverage in nightly builds, without blocking other contributions. Signed-off-by: Daniel P. Berrangé --- .gitlab-ci.yml | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dc41370..e268bad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,18 +23,21 @@ stages: after_script: - docker logout +.git_build_vars: &git_build_vars | + export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" + export SCRATCH_DIR="$PWD/scratch" + export VROOT="$SCRATCH_DIR/vroot" + export LIBDIR="$VROOT/lib" + export LD_LIBRARY_PATH="$LIBDIR" + export PATH="$VROOT/bin:$PATH" + export PKG_CONFIG_PATH="$LIBDIR/pkgconfig" + export CFLAGS="-Werror" + .git_build_job: image: $CI_REGISTRY_IMAGE/ci-$NAME:latest stage: builds before_script: - - export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" - - export SCRATCH_DIR="/tmp/scratch" - - export VROOT="$SCRATCH_DIR/vroot" - - export LIBDIR="$VROOT/lib" - - export LD_LIBRARY_PATH="$LIBDIR" - - export PATH="$VROOT/bin:$PATH" - - export PKG_CONFIG_PATH="$LIBDIR/pkgconfig" - - export CFLAGS="-Werror" + - *git_build_vars script: - pushd "$PWD" - mkdir -p "$SCRATCH_DIR" @@ -140,6 +143,11 @@ centos-8-git-build: - centos-8-container variables: NAME: centos-8 + artifacts: + expire_in: 2 days + paths: + - scratch + - build centos-7-dist-build: @@ -219,3 +227,18 @@ ubuntu-2004-dist-build: - ubuntu-2004-container variables: NAME: ubuntu-2004 + +api-coverage: + image: $CI_REGISTRY_IMAGE/ci-centos-8:latest + stage: sanity_checks + needs: + - job: centos-8-git-build + artifacts: true + before_script: + - *git_build_vars + script: + - LIBVIRT_API_COVERAGE=1 $PYTHON setup.py test + rules: + - if: '$CI_PIPELINE_SOURCE == "push"' + allow_failure: true + - if: '$CI_PIPELINE_SOURCE == "schedule"' -- cgit v1.2.1