summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2022-09-30 04:50:04 -0400
committerDaniel P. Berrangé <berrange@redhat.com>2022-09-30 12:24:31 -0400
commit4733e2a2d13cb9a85127ba17c04cc29278b31e89 (patch)
tree60fe12122796a38e659dc848e2aad3a8320e331b /.gitlab-ci.yml
parentc2374d3f4e35665263d720bb3185750e8fb4cd03 (diff)
downloadlibvirt-python-4733e2a2d13cb9a85127ba17c04cc29278b31e89.tar.gz
ci: refresh with latest lcitool manifest
This refresh switches the CI for contributors to be triggered by merge requests. Pushing to a branch in a fork will no longer run CI pipelines, in order to avoid consuming CI minutes. To regain the original behaviour contributors can opt-in to a pipeline on push git push <remote> -o ci.variable=RUN_PIPELINE=1 This variable can also be set globally on the repository, though this is not recommended. Upstream repo pushes to branches will run CI. The use of containers has changed in this update, with only the upstream repo creating containers, in order to avoid consuming contributors' limited storage quotas. A fork with existing container images may delete them. Containers will be rebuilt upstream when pushing commits with CI changes to the default branch. Any other scenario with CI changes will simply install build pre-requisite packages in a throaway environment, using the ci/buildenv/ scripts. These scripts may also be used on a contributor's local machines. With pipelines triggered by merge requests, it is also now possible to workaround the inability of contributors to run pipelines if they have run out of CI quota. A project member can trigger a pipeline from the merge request, which will run in context of upstream, however, note this should only be done after reviewing the code for any malicious CI changes. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml63
1 files changed, 46 insertions, 17 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 429ed46..563497e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,10 +15,8 @@ stages:
export CFLAGS="-Werror"
.native_git_build_job:
- extends: .gitlab_native_build_job
- before_script:
- - *git_build_vars
script:
+ - *git_build_vars
- pushd "$PWD"
- mkdir -p "$SCRATCH_DIR"
- cd "$SCRATCH_DIR"
@@ -33,31 +31,62 @@ stages:
- $PYTHON setup.py sdist
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then rpmbuild --nodeps -ta dist/libvirt-python*tar.gz ; fi
+.native_git_build_job_prebuilt_env:
+ extends:
+ - .native_git_build_job
+ - .gitlab_native_build_job_prebuilt_env
+
+.native_git_build_job_local_env:
+ extends:
+ - .native_git_build_job
+ - .gitlab_native_build_job_local_env
+
.native_build_job:
- extends: .gitlab_native_build_job
- before_script:
+ script:
- export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
- export CFLAGS="-Werror"
- script:
- $PYTHON setup.py build
- $PYTHON -m pip install .
- $PYTHON setup.py test
- $PYTHON setup.py sdist
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then rpmbuild --nodeps -ta dist/libvirt-python*tar.gz ; fi
+.native_build_job_prebuilt_env:
+ extends:
+ - .native_build_job
+ - .gitlab_native_build_job_prebuilt_env
+
+.native_build_job_local_env:
+ extends:
+ - .native_build_job
+ - .gitlab_native_build_job_local_env
+
include: '/ci/gitlab.yml'
-api-coverage:
- image: $CI_REGISTRY_IMAGE/ci-centos-stream-8:latest
+.api_coverage_job:
stage: sanity_checks
- needs:
- - job: x86_64-centos-stream-8-git
- artifacts: true
- before_script:
- - *git_build_vars
script:
+ - *git_build_vars
- LIBVIRT_API_COVERAGE=1 $PYTHON setup.py test
- rules:
- - if: '$CI_PIPELINE_SOURCE == "push"'
- allow_failure: true
- - if: '$CI_PIPELINE_SOURCE == "schedule"'
+ allow_failure: true
+
+api_coverage_prebuilt_env:
+ extends:
+ - .api_coverage_job
+ - .gitlab_native_build_job_prebuilt_env
+ needs:
+ - job: x86_64-centos-stream-8-git-prebuilt-env
+ artifacts: true
+ variables:
+ NAME: centos-stream-8
+
+api_coverage_local_env:
+ extends:
+ - .api_coverage_job
+ - .gitlab_native_build_job_local_env
+ needs:
+ - job: x86_64-centos-stream-8-git-local-env
+ artifacts: true
+ variables:
+ IMAGE: quay.io/centos/centos:stream8
+ NAME: centos-stream-8