stages: - containers - builds - docs - sanity_checks .container_job: image: docker:stable stage: containers needs: [] services: - docker:dind before_script: - export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest" - export COMMON_TAG="$CI_REGISTRY/libvirt/libvirt-python/ci-$NAME:latest" - docker info - docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" script: - docker pull "$TAG" || docker pull "$COMMON_TAG" || true - docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/ci-$NAME.Dockerfile" ci/containers - docker push "$TAG" 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: - *git_build_vars script: - pushd "$PWD" - mkdir -p "$SCRATCH_DIR" - cd "$SCRATCH_DIR" - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git - cd libvirt - meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR" - ninja -C build install - popd - $PYTHON setup.py build - $PYTHON setup.py 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 .dist_build_job: image: $CI_REGISTRY_IMAGE/ci-$NAME:latest stage: builds before_script: - export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" - export CFLAGS="-Werror" script: - $PYTHON setup.py build - $PYTHON setup.py 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 # Check that all commits are signed-off for the DCO. # Skip on "libvirt" namespace, since we only need to run # this test on developer's personal forks from which # merge requests are submitted check-dco: stage: sanity_checks needs: [] image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master script: - /check-dco except: variables: - $CI_PROJECT_NAMESPACE == 'libvirt' centos-7-container: extends: .container_job variables: NAME: centos-7 centos-8-container: extends: .container_job variables: NAME: centos-8 centos-stream-container: extends: .container_job variables: NAME: centos-stream debian-10-container: extends: .container_job variables: NAME: debian-10 debian-sid-container: extends: .container_job variables: NAME: debian-sid fedora-32-container: extends: .container_job variables: NAME: fedora-32 fedora-33-container: extends: .container_job variables: NAME: fedora-33 fedora-rawhide-container: extends: .container_job variables: NAME: fedora-rawhide opensuse-152-container: extends: .container_job variables: NAME: opensuse-152 RPM: skip ubuntu-1804-container: extends: .container_job variables: NAME: ubuntu-1804 ubuntu-2004-container: extends: .container_job variables: NAME: ubuntu-2004 centos-8-git-build: extends: .git_build_job needs: - centos-8-container variables: NAME: centos-8 artifacts: expire_in: 2 days paths: - scratch - build centos-7-dist-build: extends: .dist_build_job needs: - centos-7-container variables: NAME: centos-7 centos-8-dist-build: extends: .dist_build_job needs: - centos-8-container variables: NAME: centos-8 centos-stream-dist-build: extends: .dist_build_job needs: - centos-stream-container variables: NAME: centos-stream debian-10-dist-build: extends: .dist_build_job needs: - debian-10-container variables: NAME: debian-10 debian-sid-dist-build: extends: .dist_build_job needs: - debian-sid-container variables: NAME: debian-sid fedora-32-dist-build: extends: .dist_build_job needs: - fedora-32-container variables: NAME: fedora-32 fedora-33-dist-build: extends: .dist_build_job needs: - fedora-33-container variables: NAME: fedora-33 fedora-rawhide-dist-build: extends: .dist_build_job needs: - fedora-rawhide-container variables: NAME: fedora-rawhide opensuse-152-dist-build: extends: .dist_build_job needs: - opensuse-152-container variables: NAME: opensuse-152 RPM: skip ubuntu-1804-dist-build: extends: .dist_build_job needs: - ubuntu-1804-container variables: NAME: ubuntu-1804 ubuntu-2004-dist-build: extends: .dist_build_job needs: - 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"'