2020-04-03 18:38:48 +03:00
stages :
- prebuild
2020-04-23 15:31:48 +03:00
- 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
2020-11-23 20:58:36 +03:00
- docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers
2020-04-23 15:31:48 +03:00
- docker push "$TAG"
after_script :
- docker logout
2020-06-19 14:56:03 +03:00
.script_variables : &script_variables |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
export SCRATCH_DIR="/tmp/scratch"
export VROOT="$SCRATCH_DIR/vroot"
2020-08-18 15:55:01 +03:00
export LIBDIR="$VROOT/lib"
export LD_LIBRARY_PATH="$LIBDIR"
2020-06-19 14:56:03 +03:00
export PATH="$VROOT/bin:$PATH"
2020-08-18 15:55:01 +03:00
export PKG_CONFIG_PATH="$LIBDIR/pkgconfig"
2020-06-19 14:56:03 +03:00
.dist_native_build_job_template : &dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
image : $CI_REGISTRY_IMAGE/ci-$NAME:latest
stage : builds
before_script :
2020-06-19 14:56:03 +03:00
- *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
2020-04-23 15:31:48 +03:00
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
2020-08-18 15:55:01 +03:00
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- cd ../libvirt-glib
2020-04-23 15:31:48 +03:00
- mkdir build
- cd build
2020-08-18 15:55:01 +03:00
- ../autogen.sh --prefix="$VROOT" --libdir="$LIBDIR"
2020-04-23 15:31:48 +03:00
- $MAKE install
- cd ../../gtk-vnc
- git submodule update --init
2020-08-18 15:55:01 +03:00
- meson build --prefix="$VROOT" --libdir="$LIBDIR"
2020-04-23 15:31:48 +03:00
- $NINJA -C build install
- popd
- ./autogen.sh --prefix="$VROOT"
2020-06-24 18:05:50 +03:00
- $MAKE syntax-check
2020-06-19 14:56:03 +03:00
- $MAKE dist
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip" ; then rpmbuild --nodeps -ta virt-viewer*.tar.gz ; fi
2020-06-24 18:39:33 +03:00
# 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
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
2020-08-18 15:55:01 +03:00
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR" $MESON_OPTS
- ninja -C build install
- cd ../libvirt-glib
2020-06-24 18:39:33 +03:00
- mkdir build
- cd build
2020-08-18 15:55:01 +03:00
- ../autogen.sh $CONFIGURE_OPTS --prefix="$VROOT" --libdir="$LIBDIR"
2020-06-24 18:39:33 +03:00
- $MAKE install
- cd ../../gtk-vnc
- git submodule update --init
2020-08-18 15:55:01 +03:00
- meson build $MESON_OPTS --prefix="$VROOT" --libdir="$LIBDIR" -Dintrospection=false -Dwith-vala=false
2020-06-24 18:39:33 +03:00
- $NINJA -C build install
- popd
- ./autogen.sh $CONFIGURE_OPTS --prefix="$VROOT"
- $MAKE install
2020-04-03 18:38:48 +03:00
2020-04-23 15:23:21 +03:00
# 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 :
2020-04-03 18:38:48 +03:00
stage : prebuild
2020-04-23 15:23:21 +03:00
image : registry.gitlab.com/libvirt/libvirt-ci/check-dco:master
2020-04-03 18:38:48 +03:00
script :
2020-04-23 15:23:21 +03:00
- /check-dco virt-viewer
2020-04-03 18:38:48 +03:00
except :
2020-04-23 15:23:21 +03:00
variables :
- $CI_PROJECT_NAMESPACE == 'virt-viewer'
2020-06-19 14:56:03 +03:00
x86-centos-7-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : centos-7
2020-06-19 14:56:03 +03:00
x86-centos-8-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : centos-8
2020-06-24 18:41:25 +03:00
x86-centos-stream-container :
<< : *container_job_definition
variables :
NAME : centos-stream
2020-06-19 14:56:03 +03:00
x86-debian-10-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : debian-10
2020-06-19 14:56:03 +03:00
x86-debian-sid-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : debian-sid
2020-06-19 14:56:03 +03:00
x86-fedora-31-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : fedora-31
2020-06-19 14:56:03 +03:00
x86-fedora-32-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : fedora-32
2020-06-19 14:56:03 +03:00
x86-fedora-rawhide-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : fedora-rawhide
2020-06-19 14:56:03 +03:00
x86-opensuse-151-container :
2020-04-23 15:23:21 +03:00
<< : *container_job_definition
variables :
2020-04-23 15:31:48 +03:00
NAME : opensuse-151
2020-06-19 14:56:03 +03:00
x86-ubuntu-1804-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : ubuntu-1804
2020-06-19 14:56:03 +03:00
x86-ubuntu-2004-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
NAME : ubuntu-2004
2020-06-24 18:39:33 +03:00
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
2020-04-23 15:31:48 +03:00
2020-06-19 14:56:03 +03:00
x86-centos-7-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : centos-7
2020-06-19 14:56:03 +03:00
x86-centos-8-git-build :
<< : *git_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : centos-8
2020-06-19 14:56:03 +03:00
RPM : skip
2020-04-23 15:31:48 +03:00
2020-06-24 18:41:25 +03:00
x86-centos-stream-dist-build :
<< : *git_native_build_job_definition
variables :
NAME : centos-stream
RPM : skip
2020-06-19 14:56:03 +03:00
x86-debian-10-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : debian-10
2020-06-19 14:56:03 +03:00
x86-debian-sid-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : debian-sid
2020-06-19 14:56:03 +03:00
x86-fedora-31-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : fedora-31
2020-06-19 14:56:03 +03:00
x86-fedora-32-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : fedora-32
2020-06-19 14:56:03 +03:00
x86-fedora-rawhide-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : fedora-rawhide
2020-06-19 14:56:03 +03:00
x86-opensuse-151-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : opensuse-151
2020-06-19 14:56:03 +03:00
RPM : skip
2020-04-23 15:31:48 +03:00
2020-06-19 14:56:03 +03:00
x86-ubuntu-1804-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : ubuntu-1804
2020-06-19 14:56:03 +03:00
x86-ubuntu-2004-dist-build :
<< : *dist_native_build_job_definition
2020-04-23 15:31:48 +03:00
variables :
NAME : ubuntu-2004
2020-06-24 18:39:33 +03:00
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