-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: slightly improve the output of the end-to-end tests.
- Loading branch information
Showing
4 changed files
with
90 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# shellcheck shell=bash | ||
|
||
if [[ -n ${GITHUB_ACTION:-} ]]; then | ||
# Use special GA formatting | ||
_STYLE_OK='::notice::' | ||
_STYLE_ERR='::error::' | ||
_STYLE_NOTICE='::warning::' | ||
_STYLE_RESET= | ||
_GROUP_START='::group::' | ||
_GROUP_END='::endgroup::' | ||
elif [[ -t 2 ]]; then | ||
# Use ANSI coloring in terminal | ||
_STYLE_OK=$'\e[92m' # green | ||
_STYLE_ERR=$'\e[91m' # red | ||
_STYLE_NOTICE=$'\e[93m' # yellow | ||
_STYLE_RESET=$'\e[0m' # full reset | ||
_GROUP_START=$'\e[1m>>> ' # bold | ||
_GROUP_END= | ||
else | ||
# No styling | ||
_STYLE_OK='SUCCESS: ' | ||
_STYLE_ERR='ERROR: ' | ||
_STYLE_NOTICE='WARNING: ' | ||
_STYLE_RESET='' | ||
_GROUP_START='>>> ' | ||
_GROUP_END= | ||
fi | ||
|
||
ok() { | ||
echo "${_STYLE_OK}$*${_STYLE_RESET}" >&2 | ||
} | ||
|
||
err() { | ||
echo "${_STYLE_ERR}$*${_STYLE_RESET}" >&2 | ||
} | ||
|
||
notice() { | ||
echo "${_STYLE_NOTICE}$*${_STYLE_RESET}" >&2 | ||
} | ||
|
||
as_group() { | ||
local status=0 | ||
echo "${_GROUP_START}$1${_STYLE_RESET}" >&2 | ||
shift | ||
"$*" || status=$? | ||
echo "${_GROUP_END}" >&2 | ||
return "$status" | ||
} |