diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2021-04-09 15:33:32 +0100 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2021-04-09 16:40:42 +0100 |
commit | 38bb83e91427756dbc4bc37c52a465e9e360030c (patch) | |
tree | b4e516e6521051b0e9721d345cfe69b2a235843a /.gitlab-ci.yml | |
parent | 32a925a6d08764a873f481a3f19c0c73ea723c1e (diff) | |
download | libvirt-python-38bb83e91427756dbc4bc37c52a465e9e360030c.tar.gz |
Don't run sanity checks by default
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é <berrange@redhat.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 39 |
1 files changed, 31 insertions, 8 deletions
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"' |