virt-viewer/.gitlab-ci.yml

119 lines
3.0 KiB
YAML
Raw Normal View History

stages:
- containers
- builds
- sanity_checks
.script_variables: &script_variables |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
export SCRATCH_DIR="/tmp/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"
.native_build_job:
script:
- *script_variables
- meson build
- ninja -C build dist;
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/virt-viewer-*.tar.xz;
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
.native_git_build_job:
script:
- *script_variables
- 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
- meson build -Ddriver_libvirtd=disabled "--prefix=$VROOT" "--libdir=$LIBDIR"
- ninja -C build install
- cd ../libvirt-glib
- meson build --prefix="$VROOT" --libdir="$LIBDIR" -Ddocs=disabled
- $NINJA -C build install
- cd ../gtk-vnc
- git submodule update --init
- meson build --prefix="$VROOT" --libdir="$LIBDIR"
- $NINJA -C build install
- popd
- meson build
- ninja -C build dist;
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/virt-viewer-*.tar.xz;
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
.cross_build_job:
image: $CI_REGISTRY_IMAGE/ci-$NAME:latest
cache:
paths:
- ccache/
key: "$CI_JOB_NAME"
script:
- *script_variables
- meson build $MESON_OPTS
- $NINJA -C build
.cross_build_job_prebuilt_env:
extends:
- .cross_build_job
- .gitlab_cross_build_job_prebuilt_env
.cross_build_job_local_env:
extends:
- .cross_build_job
- .gitlab_cross_build_job_local_env
include: '/ci/gitlab.yml'
.codestyle_job:
stage: sanity_checks
script:
- *script_variables
- 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)
codestyle_prebuilt_env:
extends:
- .codestyle_job
- .gitlab_native_build_job_prebuilt_env
needs:
- job: x86_64-centos-stream-8-container
optional: true
variables:
NAME: centos-stream-8
codestyle_local_env:
extends:
- .codestyle_job
- .gitlab_native_build_job_local_env
variables:
IMAGE: quay.io/centos/centos:stream8
NAME: centos-stream-8