gitlab: avoid building libvirt twice and running syntax-check twice

In the distros using RPMs, we build libvirt once as a side effect
of running "ninja dist", and once via rpmbuild.

In addition "ninja dist" will run all tests including the "syntax-check"
suite, despite use having a separate "codestyle" job for for that.

There is no way to pass "--no-suite" when creating the dist, but if we
switch to invoking "meson dist", we can skip the build+test part
entirely  using "--no-tests".

When doing this we then run explicit "meson compile" and "meson test"
commands for the distros that don't build the RPMs, and in the latter
case we can now skip the "syntax-check" suite.

The RPM builds already skipped the "syntax-check" suite.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2021-05-10 18:14:12 +01:00
parent b56e2be68e
commit 156315cff4
2 changed files with 8 additions and 3 deletions

View File

@ -61,10 +61,13 @@ stages:
- *script_variables
script:
- meson setup build --werror || (cat build/meson-logs/meson-log.txt && exit 1)
- meson dist -C build
- meson dist -C build --no-tests
- if test -x /usr/bin/rpmbuild && test "$RPM" != "skip";
then
rpmbuild --nodeps -ta build/meson-dist/libvirt-*.tar.xz;
else
meson compile -C build;
meson test -C build --no-suite syntax-check --print-errorlogs;
fi
# Jobs that we delegate to Cirrus CI because they require an operating
@ -124,7 +127,7 @@ stages:
script:
- meson setup build --werror $MESON_OPTS || (cat build/meson-logs/meson-log.txt && exit 1)
- meson compile -C build
- if test "$CROSS" = "i686" ; then meson test -C build --print-errorlogs ; fi
- if test "$CROSS" = "i686" ; then meson test -C build --no-suite syntax-check --print-errorlogs ; fi
# Native container build jobs

View File

@ -23,4 +23,6 @@ build_task:
- git reset --hard "$CI_COMMIT_SHA"
build_script:
- meson setup build
- meson dist -C build
- meson dist -C build --no-tests
- meson compile -C build
- meson test -C build --no-suite syntax-check