1
1
mirror of https://github.com/kanaka/mal.git synced 2024-08-16 17:20:23 +03:00

ci.sh: re-order output to make log parsing easier.

This commit is contained in:
Joel Martin 2021-04-25 18:48:01 -05:00
parent 21b103f692
commit 8faee3c26a

39
ci.sh
View File

@ -5,6 +5,8 @@ set -ex
ACTION=${1}
IMPL=${2}
die() { local ret=$1; shift; echo >&2 "${*}"; exit $ret; }
# Environment variable configuration
BUILD_IMPL=${BUILD_IMPL:-${IMPL}}
@ -12,40 +14,39 @@ if [ "${DO_SELF_HOST}" ]; then
MAL_IMPL=${IMPL}
IMPL=mal
fi
if [ "${DO_HARD}" ]; then
TEST_OPTS="${TEST_OPTS} --hard"
fi
echo "ACTION: ${ACTION}"
echo "IMPL: ${IMPL}"
echo "BUILD_IMPL: ${BUILD_IMPL}"
echo "MAL_IMPL: ${MAL_IMPL}"
if [ "${NO_PERF}" -a "${ACTION}" = "perf" ]; then
echo "Skipping perf test"
exit 0
fi
if [ "${NO_SELF_HOST}" -a "${DO_SELF_HOST}" ]; then
echo "Skipping ${ACTION} of ${MAL_IMPL} self-host"
exit 0
fi
if [ "${NO_SELF_HOST_PERF}" -a "${DO_SELF_HOST}" -a "${ACTION}" = "perf" ]; then
echo "Skipping only perf test for ${MAL_IMPL} self-host"
exit 0
fi
raw_mode_var=${MAL_IMPL:-${IMPL}}_MODE
mode_var=${raw_mode_var/-/__}
mode_var=${mode_var/./__}
mode_val=${!mode_var}
MAKE="make ${mode_val:+${mode_var}=${mode_val}}"
log_prefix="${ACTION}${REGRESS:+-regress}-${IMPL}${mode_val:+-${mode_val}}"
TEST_OPTS="${TEST_OPTS} --debug-file ../../${log_prefix}.debug"
# Log everything below this point:
exec &> >(tee ./${log_prefix}.log)
MAKE="make ${mode_val:+${mode_var}=${mode_val}}"
if [ "${NO_PERF}" -a "${ACTION}" = "perf" ]; then
die 0 "Skipping perf test"
fi
if [ "${NO_SELF_HOST}" -a "${DO_SELF_HOST}" ]; then
die 0 "Skipping ${ACTION} of ${MAL_IMPL} self-host"
fi
if [ "${NO_SELF_HOST_PERF}" -a "${DO_SELF_HOST}" -a "${ACTION}" = "perf" ]; then
die 0 "Skipping only perf test for ${MAL_IMPL} self-host"
fi
echo "ACTION: ${ACTION}"
echo "IMPL: ${IMPL}"
echo "BUILD_IMPL: ${BUILD_IMPL}"
echo "MAL_IMPL: ${MAL_IMPL}"
echo "TEST_OPTS: ${TEST_OPTS}"
# If NO_DOCKER is blank then launch use a docker image, otherwise use
# the Travis/Github Actions image/tools directly.