@@ -189,7 +189,7 @@ MAKEFLAGS="$MAKEFLAGS SKIP_DASHED_BUILT_INS=$SKIP_DASHED_BUILT_INS"
case "$CI_TYPE" in
github-actions)
setenv --test GIT_PROVE_OPTS "--timer --jobs $NPROC"
- GIT_TEST_OPTS="--verbose-log -x"
+ GIT_TEST_OPTS="--verbose-log -x --github-workflow-markup"
test Windows != "$RUNNER_OS" ||
GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
setenv --test GIT_TEST_OPTS "$GIT_TEST_OPTS"
@@ -8,25 +8,70 @@ set -e
. ${0%/*}/lib-ci-type.sh
. ${0%/*}/lib-tput.sh
+github_workflow_markup=auto
+case "$CI_TYPE" in
+github-actions)
+ github_workflow_markup=t
+ ;;
+esac
+
+while test $# != 0
+do
+ case "$1" in
+ --github-workflow-markup)
+ github_workflow_markup=t
+ ;;
+ --no-github-workflow-markup)
+ github_workflow_markup=
+ ;;
+ *)
+ echo "BUG: invalid $0 argument: $1" >&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+
if ! ls t/test-results/*.exit >/dev/null 2>/dev/null
then
echo "Build job failed before the tests could have been run"
exit
fi
+failed=
for TEST_EXIT in t/test-results/*.exit
do
if [ "$(cat "$TEST_EXIT")" != "0" ]
then
+ failed=t
TEST_NAME="${TEST_EXIT%.exit}"
TEST_NAME="${TEST_NAME##*/}"
TEST_OUT="${TEST_NAME}.out"
TEST_MARKUP="${TEST_NAME}.markup"
- echo "------------------------------------------------------------------------"
- echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)"
- echo "------------------------------------------------------------------------"
- cat "t/test-results/${TEST_OUT}"
+ do_markup=
+ case "$github_workflow_markup" in
+ t)
+ do_markup=t
+ ;;
+ auto)
+ if test -f "t/test-results/$TEST_MARKUP"
+ then
+ do_markup=t
+ fi
+ ;;
+ esac
+
+ if test -n "$do_markup"
+ then
+ printf "\\e[33m\\e[1m=== Failed test: ${TEST_NAME} ===\\e[m\\n"
+ cat "t/test-results/$TEST_MARKUP"
+ else
+ echo "------------------------------------------------------------------------"
+ echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)"
+ echo "------------------------------------------------------------------------"
+ cat "t/test-results/${TEST_OUT}"
+ fi
trash_dir="trash directory.$TEST_NAME"
case "$CI_TYPE" in
@@ -48,4 +93,13 @@ then
then
echo "FAILED_TEST_ARTIFACTS=t/failed-test-artifacts" >>$GITHUB_ENV
fi
+
+ case "$github_workflow_markup" in
+ t|auto)
+ exit 1
+ ;;
+ '')
+ exit 0
+ ;;
+ esac
fi