gitlab CI: replace the meson-build.sh with the libinput one

The libinput one is more generic and expressive, taking arguments and
whatnot.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2023-01-05 09:25:26 +10:00
parent ac3d44ee7a
commit 6d0d778e59

View file

@ -1,9 +1,38 @@
#!/bin/bash #!/usr/bin/env bash
set -x
if [[ -f .meson_environment ]]; then if [[ -f .meson_environment ]]; then
. .meson_environment . .meson_environment
fi fi
# If test args are set, we assume we want to run the tests
MESON_RUN_TEST="$MESON_TEST_ARGS"
while [[ $# -gt 0 ]]; do
case $1 in
--skip-setup)
shift
MESON_SKIP_SETUP="1"
;;
--skip-build)
shift
MESON_SKIP_BUILD="1"
;;
--skip-test)
shift
MESON_RUN_TEST=""
;;
--run-test)
shift
MESON_RUN_TEST="1"
;;
*)
echo "Unknow commandline argument $1"
exit 1
;;
esac
done
if [[ -z "$MESON_BUILDDIR" ]]; then if [[ -z "$MESON_BUILDDIR" ]]; then
echo "\$MESON_BUILDDIR undefined." echo "\$MESON_BUILDDIR undefined."
exit 1 exit 1
@ -20,6 +49,10 @@ if [[ -z "$CI_JOB_ID" ]] || [[ -z "$CI_JOB_NAME" ]]; then
echo " CI_JOB_NAME=$CI_JOB_NAME" echo " CI_JOB_NAME=$CI_JOB_NAME"
fi fi
if [[ -n "$FDO_CI_CONCURRENT" ]]; then
NINJA_ARGS="-j$FDO_CI_CONCURRENT $NINJA_ARGS"
export MESON_TESTTHREADS="$FDO_CI_CONCURRENT"
fi
echo "*************************************************" echo "*************************************************"
echo "builddir: $MESON_BUILDDIR" echo "builddir: $MESON_BUILDDIR"
@ -30,20 +63,16 @@ echo "*************************************************"
set -e set -e
rm -rf "$MESON_BUILDDIR" if [[ -z "$MESON_SKIP_SETUP" ]]; then
meson "$MESON_BUILDDIR" $MESON_ARGS rm -rf "$MESON_BUILDDIR"
meson setup "$MESON_BUILDDIR" $MESON_ARGS
fi
meson configure "$MESON_BUILDDIR" meson configure "$MESON_BUILDDIR"
ninja -C "$MESON_BUILDDIR" $NINJA_ARGS
if [[ ! -z "$SKIP_MESON_TEST" ]]; then if [[ -z "$MESON_SKIP_BUILD" ]]; then
echo "Skipping meson test" ninja -C "$MESON_BUILDDIR" $NINJA_ARGS
exit 0
fi fi
# we still want to generate the reports, even if meson test fails if [[ -n "$MESON_RUN_TEST" ]]; then
set +e meson test -C "$MESON_BUILDDIR" $MESON_TEST_ARGS --print-errorlogs
meson test -C "$MESON_BUILDDIR" $MESON_TEST_ARGS --print-errorlogs fi
exit_code=$?
set -e
exit $exit_code