2020-04-03 18:38:48 +03:00
stages :
2020-04-23 15:31:48 +03:00
- containers
- builds
2021-01-13 14:21:45 +03:00
- sanity_checks
2020-04-23 15:31:48 +03:00
.container_job_template : &container_job_definition
image : docker:stable
stage : containers
services :
2021-07-27 16:55:13 +03:00
- name : registry.gitlab.com/libvirt/libvirt-ci/docker-dind:master
alias : docker
2020-04-23 15:31:48 +03:00
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-12-01 22:17:04 +03:00
- docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/ci-$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 :
2021-01-13 14:18:35 +03:00
- meson build
- if test "$DIST" != "skip";
then
ninja -C build dist;
else
ninja -C build;
ninja -C build test;
fi
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/virt-viewer-*.tar.xz;
fi
2020-06-19 14:56:03 +03:00
.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
2021-01-12 21:34:27 +03:00
- meson build --prefix="$VROOT" --libdir="$LIBDIR" -Ddocs=disabled
- $NINJA -C build install
- cd ../gtk-vnc
2020-04-23 15:31:48 +03:00
- 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
2021-01-13 14:18:35 +03:00
- meson build
- if test "$DIST" != "skip";
then
ninja -C build dist;
else
ninja -C build;
ninja -C build test;
fi
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/virt-viewer-*.tar.xz;
fi
2020-06-19 14:56:03 +03:00
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
2021-01-12 21:34:27 +03:00
- meson build --prefix="$VROOT" --libdir="$LIBDIR" -Ddocs=disabled $MESON_OPTS
- $NINJA -C build install
- cd ../gtk-vnc
2020-06-24 18:39:33 +03:00
- git submodule update --init
2021-01-11 20:01:38 +03:00
- meson build $MESON_OPTS --prefix="$VROOT" --libdir="$LIBDIR" -Dintrospection=disabled
2020-06-24 18:39:33 +03:00
- $NINJA -C build install
- popd
2021-01-13 14:18:35 +03:00
- meson build $MESON_OPTS
- $NINJA -C build
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 :
2021-01-13 14:21:45 +03:00
stage : sanity_checks
needs : [ ]
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-11-23 21:03:40 +03:00
x86-fedora-32-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
2020-11-23 21:03:40 +03:00
NAME : fedora-32
2020-04-23 15:31:48 +03:00
2020-11-23 21:03:40 +03:00
x86-fedora-33-container :
2020-04-23 15:31:48 +03:00
<< : *container_job_definition
variables :
2020-11-23 21:03:40 +03:00
NAME : fedora-33
2020-04-23 15:31:48 +03:00
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
2021-01-13 15:16:03 +03:00
x86-opensuse-152-container :
2020-04-23 15:23:21 +03:00
<< : *container_job_definition
variables :
2021-01-13 15:16:03 +03:00
NAME : opensuse-152
2020-04-23 15:31:48 +03:00
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
2021-01-13 14:18:35 +03:00
codestyle :
2021-01-13 14:21:45 +03:00
stage : sanity_checks
2021-01-13 14:18:35 +03:00
image : $CI_REGISTRY_IMAGE/ci-centos-8:latest
needs :
- x86-centos-8-container
before_script :
- *script_variables
script :
- meson build || (cat build/meson-logs/meson-log.txt && exit 1)
- meson test -C build --suite syntax-check --no-rebuild || (cat build/meson-logs/testlog.txt && exit 1)
2020-06-19 14:56:03 +03:00
x86-centos-7-dist-build :
<< : *dist_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-centos-7-container
2020-04-23 15:31:48 +03:00
variables :
NAME : centos-7
2021-01-13 14:18:35 +03:00
# git is too old for -C args
DIST : skip
RPM : skip
2020-04-23 15:31:48 +03:00
2020-06-19 14:56:03 +03:00
x86-centos-8-git-build :
<< : *git_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-centos-8-container
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
2021-01-13 14:21:45 +03:00
needs :
- x86-centos-stream-container
2020-06-24 18:41:25 +03:00
variables :
NAME : centos-stream
RPM : skip
2020-06-19 14:56:03 +03:00
x86-debian-10-dist-build :
<< : *dist_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-debian-10-container
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
2021-01-13 14:21:45 +03:00
needs :
- x86-debian-sid-container
2020-04-23 15:31:48 +03:00
variables :
NAME : debian-sid
2020-11-23 21:03:40 +03:00
x86-fedora-32-dist-build :
2020-06-19 14:56:03 +03:00
<< : *dist_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-fedora-32-container
2020-04-23 15:31:48 +03:00
variables :
2020-11-23 21:03:40 +03:00
NAME : fedora-32
2020-04-23 15:31:48 +03:00
2020-11-23 21:03:40 +03:00
x86-fedora-33-dist-build :
2020-06-19 14:56:03 +03:00
<< : *dist_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-fedora-33-container
2020-04-23 15:31:48 +03:00
variables :
2020-11-23 21:03:40 +03:00
NAME : fedora-33
2020-04-23 15:31:48 +03:00
2020-06-19 14:56:03 +03:00
x86-fedora-rawhide-dist-build :
<< : *dist_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-fedora-rawhide-container
2020-04-23 15:31:48 +03:00
variables :
NAME : fedora-rawhide
2021-01-13 15:16:03 +03:00
x86-opensuse-152-dist-build :
2020-06-19 14:56:03 +03:00
<< : *dist_native_build_job_definition
2021-01-13 14:21:45 +03:00
needs :
- x86-opensuse-152-container
2020-04-23 15:31:48 +03:00
variables :
2021-01-13 15:16:03 +03:00
NAME : opensuse-152
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
2021-01-13 14:21:45 +03:00
needs :
- x86-ubuntu-1804-container
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
2021-01-13 14:21:45 +03:00
needs :
- x86-ubuntu-2004-container
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
2021-01-13 14:21:45 +03:00
needs :
- mingw32-fedora-rawhide-container
2020-06-24 18:39:33 +03:00
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
2021-01-13 14:21:45 +03:00
needs :
- mingw64-fedora-rawhide-container
2020-06-24 18:39:33 +03:00
variables :
NAME : fedora-rawhide-cross-mingw64
artifacts :
name : 'x64-msi'
when : on_success
expire_in : 30 days
paths :
- data/virt-viewer-x64*.msi.pot