@@ -129,11 +129,7 @@ jobs:
shell: bash
- name: test
shell: bash
- run: . /etc/profile && make -C t -e
- - name: ci/print-test-failures.sh
- if: failure()
- shell: bash
- run: ci/print-test-failures.sh
+ run: . /etc/profile && make -C t -e || ci/print-test-failures.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v2
@@ -218,11 +214,7 @@ jobs:
shell: bash
- name: test
shell: bash
- run: . /etc/profile && make -C t -e
- - name: ci/print-test-failures.sh
- if: failure()
- shell: bash
- run: ci/print-test-failures.sh
+ run: . /etc/profile && make -C t -e || ci/print-test-failures-github.sh
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v2
@@ -265,10 +257,8 @@ jobs:
- run: ci/lib.sh --build
- run: make
- run: ci/lib.sh --test
- - run: make test
+ - run: make test || ci/print-test-failures-github.sh
if: success()
- - run: ci/print-test-failures.sh
- if: failure()
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v2
@@ -302,10 +292,8 @@ jobs:
- run: make
- run: ci/lib.sh --test
if: success() && matrix.vector.skip-tests != 'yes'
- - run: make test
+ - run: make test || ci/print-test-failures-github.sh
if: success() && matrix.vector.skip-tests != 'yes'
- - run: ci/print-test-failures.sh
- if: failure() && matrix.vector.skip-tests != 'yes'
- name: Upload failed tests' directories
if: failure() && env.FAILED_TEST_ARTIFACTS != ''
uses: actions/upload-artifact@v1
@@ -8,13 +8,32 @@ set -e
. ${0%/*}/lib-ci-type.sh
. ${0%/*}/lib-tput.sh
-exit_code=
+case "$CI_TYPE" in
+github-actions)
+ exit_code=t
+ github_workflow_markup=t
+ ;;
+*)
+ exit_code=
+ github_workflow_markup=
+ ;;
+esac
+
while test $# != 0
do
case "$1" in
--exit-code)
exit_code=t
;;
+ --no-exit-code)
+ exit_code=
+ ;;
+ --github-workflow-markup)
+ github_workflow_markup=t
+ ;;
+ --no-github-workflow-markup)
+ github_workflow_markup=
+ ;;
*)
echo "BUG: invalid $0 argument: $1" >&2
exit 1
@@ -40,9 +59,14 @@ do
TEST_OUT="${TEST_NAME}.out"
TEST_MARKUP="${TEST_NAME}.markup"
- echo "------------------------------------------------------------------------"
- echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)"
- echo "------------------------------------------------------------------------"
+ if test -n "$github_workflow_markup"
+ then
+ printf "\\e[33m\\e[1m=== Failed test: ${TEST_NAME} ===\\e[m\\n"
+ else
+ echo "------------------------------------------------------------------------"
+ echo "$(tput setaf 1)${TEST_OUT}...$(tput sgr0)"
+ echo "------------------------------------------------------------------------"
+ fi
cat "t/test-results/${TEST_OUT}"
trash_dir="trash directory.$TEST_NAME"