stages: - prebuild - containers - builds .container_job_template: &container_job_definition image: docker:stable stage: containers services: - docker:dind before_script: - export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest" - export COMMON_TAG="$CI_REGISTRY/virt-viewer/virt-viewer/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/$NAME.Dockerfile" ci - docker push "$TAG" after_script: - docker logout .script_variables: &script_variables | export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)" export SCRATCH_DIR="/tmp/scratch" export VROOT="$SCRATCH_DIR/vroot" export LD_LIBRARY_PATH="$VROOT/lib" export PATH="$VROOT/bin:$PATH" export PKG_CONFIG_PATH="$VROOT/lib/pkgconfig" .dist_native_build_job_template: &dist_native_build_job_definition image: $CI_REGISTRY_IMAGE/ci-$NAME:latest stage: builds before_script: - *script_variables script: - ./autogen.sh --prefix="$VROOT" - $MAKE dist - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then rpmbuild --nodeps -ta virt-viewer*.tar.gz ; fi .git_native_build_job_template: &git_native_build_job_definition image: $CI_REGISTRY_IMAGE/ci-$NAME:latest stage: builds before_script: - *script_variables script: - pushd "$PWD" - mkdir -p "$SCRATCH_DIR" - cd "$SCRATCH_DIR" - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git - git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git - git clone --depth 1 https://gitlab.gnome.org/GNOME/gtk-vnc.git - cd libvirt - mkdir build - cd build - ../autogen.sh --prefix="$VROOT" --libdir="$VROOT/lib" --without-libvirtd - $MAKE install - cd ../../libvirt-glib - mkdir build - cd build - ../autogen.sh --prefix="$VROOT" --libdir="$VROOT/lib" - $MAKE install - cd ../../gtk-vnc - git submodule update --init - meson build --prefix="$VROOT" --libdir="$VROOT/lib" - $NINJA -C build install - popd - ./autogen.sh --prefix="$VROOT" - $MAKE syntax-check - $MAKE dist - if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then rpmbuild --nodeps -ta virt-viewer*.tar.gz ; fi # Default cross build jobs that are always run .git_cross_build_default_job_template: &git_cross_build_default_job_definition image: $CI_REGISTRY_IMAGE/ci-$NAME:latest stage: builds cache: paths: - ccache/ key: "$CI_JOB_NAME" before_script: - *script_variables - export PATH=/usr/$ABI/sys-root/mingw/bin:$PATH script: - pushd "$PWD" - mkdir -p "$SCRATCH_DIR" - cd "$SCRATCH_DIR" - git clone --depth 1 https://gitlab.com/libvirt/libvirt.git - git clone --depth 1 https://gitlab.com/libvirt/libvirt-glib.git - git clone --depth 1 https://gitlab.gnome.org/GNOME/gtk-vnc.git - cd libvirt - mkdir build - cd build - ../autogen.sh $CONFIGURE_OPTS --prefix="$VROOT" --libdir="$VROOT/lib" --without-libvirtd - $MAKE install - cd ../../libvirt-glib - mkdir build - cd build - ../autogen.sh $CONFIGURE_OPTS --prefix="$VROOT" --libdir="$VROOT/lib" - $MAKE install - cd ../../gtk-vnc - git submodule update --init - meson build $MESON_OPTS --prefix="$VROOT" --libdir="$VROOT/lib" -Dintrospection=false -Dwith-vala=false - $NINJA -C build install - popd - ./autogen.sh $CONFIGURE_OPTS --prefix="$VROOT" - $MAKE install # Check that all commits are signed-off for the DCO. # Skip on "virt-viewer" namespace, since we only need to run # this test on developer's personal forks from which # merge requests are submitted check-dco: stage: prebuild image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master script: - /check-dco virt-viewer except: variables: - $CI_PROJECT_NAMESPACE == 'virt-viewer' x86-centos-7-container: <<: *container_job_definition variables: NAME: centos-7 x86-centos-8-container: <<: *container_job_definition variables: NAME: centos-8 x86-centos-stream-container: <<: *container_job_definition variables: NAME: centos-stream x86-debian-9-container: <<: *container_job_definition variables: NAME: debian-9 x86-debian-10-container: <<: *container_job_definition variables: NAME: debian-10 x86-debian-sid-container: <<: *container_job_definition variables: NAME: debian-sid x86-fedora-31-container: <<: *container_job_definition variables: NAME: fedora-31 x86-fedora-32-container: <<: *container_job_definition variables: NAME: fedora-32 x86-fedora-rawhide-container: <<: *container_job_definition variables: NAME: fedora-rawhide x86-opensuse-151-container: <<: *container_job_definition variables: NAME: opensuse-151 x86-ubuntu-1804-container: <<: *container_job_definition variables: NAME: ubuntu-1804 x86-ubuntu-2004-container: <<: *container_job_definition variables: NAME: ubuntu-2004 mingw32-fedora-rawhide-container: <<: *container_job_definition variables: NAME: fedora-rawhide-cross-mingw32 mingw64-fedora-rawhide-container: <<: *container_job_definition variables: NAME: fedora-rawhide-cross-mingw64 x86-centos-7-dist-build: <<: *dist_native_build_job_definition variables: NAME: centos-7 x86-centos-8-git-build: <<: *git_native_build_job_definition variables: NAME: centos-8 RPM: skip x86-centos-stream-dist-build: <<: *git_native_build_job_definition variables: NAME: centos-stream RPM: skip x86-debian-9-dist-build: <<: *dist_native_build_job_definition variables: NAME: debian-9 x86-debian-10-dist-build: <<: *dist_native_build_job_definition variables: NAME: debian-10 x86-debian-sid-dist-build: <<: *dist_native_build_job_definition variables: NAME: debian-sid x86-fedora-31-dist-build: <<: *dist_native_build_job_definition variables: NAME: fedora-31 x86-fedora-32-dist-build: <<: *dist_native_build_job_definition variables: NAME: fedora-32 x86-fedora-rawhide-dist-build: <<: *dist_native_build_job_definition variables: NAME: fedora-rawhide x86-opensuse-151-dist-build: <<: *dist_native_build_job_definition variables: NAME: opensuse-151 RPM: skip x86-ubuntu-1804-dist-build: <<: *dist_native_build_job_definition variables: NAME: ubuntu-1804 x86-ubuntu-2004-dist-build: <<: *dist_native_build_job_definition variables: NAME: ubuntu-2004 mingw32-fedora-rawhide-git-build: <<: *git_cross_build_default_job_definition variables: NAME: fedora-rawhide-cross-mingw32 artifacts: name: 'x86-msi' when: on_success expire_in: 30 days paths: - data/virt-viewer-x86*.msi.pot mingw64-fedora-rawhide-git-build: <<: *git_cross_build_default_job_definition variables: NAME: fedora-rawhide-cross-mingw64 artifacts: name: 'x64-msi' when: on_success expire_in: 30 days paths: - data/virt-viewer-x64*.msi.pot