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 diff --git a/src/nvim/testdir/runnvim.sh b/src/nvim/testdir/runnvim.sh index 72f9254635..25cb8437b4 100755 --- a/src/nvim/testdir/runnvim.sh +++ b/src/nvim/testdir/runnvim.sh @@ -66,7 +66,7 @@ main() {( fi fi if test "$FAILED" = 1 ; then - travis_fold start "$NVIM_TEST_CURRENT_SUITE/$test_name" + ci_fold start "$NVIM_TEST_CURRENT_SUITE/$test_name" fi valgrind_check . if test -n "$LOG_DIR" ; then @@ -78,7 +78,7 @@ main() {( fi rm -f "$tlog" if test "$FAILED" = 1 ; then - travis_fold end "$NVIM_TEST_CURRENT_SUITE/$test_name" + ci_fold end "$NVIM_TEST_CURRENT_SUITE/$test_name" fi if test "$FAILED" = 1 ; then echo "Test $test_name failed, see output above and summary for more details" >> test.log