aboutsummaryrefslogtreecommitdiff
path: root/ci/common/suite.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ci/common/suite.sh')
-rw-r--r--ci/common/suite.sh41
1 files changed, 29 insertions, 12 deletions
diff --git a/ci/common/suite.sh b/ci/common/suite.sh
index 4c42f06c60..038b116c5a 100644
--- a/ci/common/suite.sh
+++ b/ci/common/suite.sh
@@ -13,16 +13,33 @@ FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
ANSI_CLEAR="\033[0K"
-travis_fold() {
- local action="$1"
- local name="$2"
- name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
- name="$(echo -n "$name" | sed 's/-$//')"
- echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
-}
-
-if test "$TRAVIS" != "true" ; then
- travis_fold() {
+if test "$TRAVIS" = "true"; then
+ ci_fold() {
+ local action="$1"
+ local name="$2"
+ name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
+ name="$(echo -n "$name" | sed 's/-$//')"
+ echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
+ }
+elif test "$GITHUB_ACTIONS" = "true"; then
+ ci_fold() {
+ local action="$1"
+ local name="$2"
+ name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
+ name="$(echo -n "$name" | sed 's/-$//')"
+ case "$action" in
+ start)
+ echo "::group::${name}"
+ ;;
+ end)
+ echo "::endgroup::"
+ ;;
+ *)
+ :;;
+ esac
+ }
+else
+ ci_fold() {
return 0
}
fi
@@ -33,7 +50,7 @@ enter_suite() {
rm -f "${END_MARKER}"
local suite_name="$1"
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
- travis_fold start "${NVIM_TEST_CURRENT_SUITE}"
+ ci_fold start "${NVIM_TEST_CURRENT_SUITE}"
set -x
}
@@ -43,7 +60,7 @@ exit_suite() {
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
echo "${FAIL_SUMMARY}"
else
- travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
+ ci_fold end "${NVIM_TEST_CURRENT_SUITE}"
fi
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
if test "$1" != "--continue" ; then