stages: - prebuild - builds .multilib: &multilib | dpkg_architecture=$(which dpkg-architecture 2>/dev/null || true) rpm=$(which rpm 2>/dev/null || true) if test -x "$dpkg_architecture"; then multilib=$(dpkg-architecture -q DEB_TARGET_MULTIARCH); elif test -x "$rpm"; then multilib=$(rpm --eval '%{_lib}'); fi .native-environment: &native-environment | export VIRT_PREFIX="$HOME/build/libvirt" export PATH="$VIRT_PREFIX/bin:$PATH" export C_INCLUDE_PATH="$VIRT_PREFIX/include" export LD_LIBRARY_PATH="$VIRT_PREFIX/$multilib" export PKG_CONFIG_PATH="$VIRT_PREFIX/$multilib/pkgconfig" export XDG_DATA_DIRS="$VIRT_PREFIX/share:/usr/share:/usr/local/share" export GI_TYPELIB_PATH="$VIRT_PREFIX/$multilib/girepository-1.0" export OSINFO_SYSTEM_DIR="$VIRT_PREFIX/share/osinfo" export MAKEFLAGS="-j $(getconf _NPROCESSORS_ONLN)" export CCACHE_BASEDIR="$(pwd)" export CCACHE_DIR="$CCACHE_BASEDIR/ccache" export CCACHE_MAXSIZE="50M" export PATH="$CCACHE_WRAPPERSDIR:$PATH" .mingw-environment: &mingw-environment | export VIRT_PREFIX="$VIRT_PREFIX/$ABI/sys-root/mingw" export PKG_CONFIG_PATH="$VIRT_PREFIX/lib/pkgconfig" .osinfo-db-tools-build: &osinfo-db-tools-build | pushd /tmp/ git clone https://gitlab.com/libosinfo/osinfo-db-tools.git cd osinfo-db-tools mkdir build cd build meson .. . --prefix=$VIRT_PREFIX --werror $NINJA install popd .osinfo-db-build: &osinfo-db-build | pushd /tmp/ git clone https://gitlab.com/libosinfo/osinfo-db.git cd osinfo-db mkdir build cd build $MAKE -f ../Makefile VPATH=.. $MAKE -f ../Makefile VPATH=.. check $MAKE -f ../Makefile VPATH=.. install OSINFO_DB_TARGET="--system" popd .libosinfo-build: &libosinfo-build | pushd . mkdir build cd build meson .. . --prefix=$VIRT_PREFIX --werror $NINJA $NINJA install popd .libosinfo-check: &libosinfo-check | pushd . cd build $NINJA test popd .libosinfo-rpm: &libosinfo-rpm | if test "$RPM" = "skip"; then exit 0 fi pushd . cd build sed -i -e 's/BuildRequires: *osinfo-db.*//' *.spec* $NINJA dist rpmbuild --clean --define "_topdir `pwd`/rpmbuild" -ta meson-dist/*.tar.xz popd .libosinfo-mingw-build: &libosinfo-mingw-build | pushd . mkdir build cd build meson .. . --cross-file=/usr/share/mingw/toolchain-$CROSS.meson --prefix=$VIRT_PREFIX -Denable-gtk-doc=false -Denable-tests=false -Denable-introspection=disabled -Denable-vala=disabled --werror $NINJA $NINJA install popd .native-build-job: &native-build-job stage: builds image: quay.io/libvirt/buildenv-libosinfo-$NAME:latest cache: paths: - ccache key: "$CI_JOB_NAME" script: - *multilib - *native-environment - *osinfo-db-tools-build - *osinfo-db-build - *libosinfo-build - *libosinfo-check - *libosinfo-rpm .mingw-build-job: &mingw-build-job stage: builds image: quay.io/libvirt/buildenv-libosinfo-$NAME-cross-$CROSS:latest cache: paths: - ccache key: "$CI_JOB_NAME" script: - *multilib - *native-environment - *osinfo-db-tools-build - *osinfo-db-build - *mingw-environment - *libosinfo-mingw-build # Check that all commits are signed-off for the DCO. # Skip on "libosinfo" 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 libosinfo except: variables: - $CI_PROJECT_NAMESPACE == "libosinfo" centos-7: <<: *native-build-job variables: NAME: centos-7 RPM: skip centos-8: <<: *native-build-job variables: NAME: centos-8 debian-9: <<: *native-build-job variables: NAME: debian-9 RPM: skip debian-10: <<: *native-build-job variables: NAME: debian-10 RPM: skip debian-sid: <<: *native-build-job variables: NAME: debian-sid RPM: skip fedora-31: <<: *native-build-job variables: NAME: fedora-31 fedora-32: <<: *native-build-job variables: NAME: fedora-32 fedora-rawhide: <<: *native-build-job variables: NAME: fedora-rawhide fedora-rawhide-cross-mingw32: <<: *mingw-build-job variables: NAME: fedora-rawhide CROSS: mingw32 fedora-rawhide-cross-mingw64: <<: *mingw-build-job variables: NAME: fedora-rawhide CROSS: mingw64 opensuse-151: <<: *native-build-job variables: NAME: opensuse-151 RPM: skip ubuntu-1804: script: <<: *native-build-job variables: NAME: ubuntu-1804 RPM: skip ubuntu-2004: <<: *native-build-job variables: NAME: ubuntu-2004 RPM: skip