mirror of
https://github.com/netdata/libbpf.git
synced 2026-11-05 17:30:15 +08:00
ci: create helpers for formatting errors and notices
Create helpers for formatting errors and notices for GitHub actions, instead of directly printing the double colons and attributes.
This commit is contained in:
1 parent
4374bad784
commit
7f11cd48d6
2 files changed
+22
-2
No files matched your search
@@ -24,3 +24,23 @@ travis_fold() {
|
||||
}
|
||||
|
||||
ARCH=$(uname -m)
|
||||
|
||||
__print() {
|
||||
local TITLE=""
|
||||
if [[ -n $2 ]]; then
|
||||
TITLE=" title=$2"
|
||||
fi
|
||||
echo "::$1${TITLE}::$3"
|
||||
}
|
||||
|
||||
# $1 - title
|
||||
# $2 - message
|
||||
print_error() {
|
||||
__print error $1 $2
|
||||
}
|
||||
|
||||
# $1 - title
|
||||
# $2 - message
|
||||
print_notice() {
|
||||
__print notice $1 $2
|
||||
}
|
||||
@@ -420,9 +420,9 @@ if [[ "${KERNEL}" = 'LATEST' ]]; then
|
||||
"${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf/test_bpftool_synctypes.py" && true
|
||||
test_results["bpftool"]=$?
|
||||
if [[ ${test_results["bpftool"]} -eq 0 ]]; then
|
||||
echo "::notice title=bpftool_checks::bpftool checks passed successfully."
|
||||
print_notice bpftool_checks "bpftool checks passed successfully."
|
||||
else
|
||||
echo "::error title=bpftool_checks::bpftool checks returned ${test_results["bpftool"]}."
|
||||
print_error bpftool_checks "bpftool checks returned ${test_results["bpftool"]}."
|
||||
fi
|
||||
else
|
||||
echo "Consistency checks skipped."
|
||||
|
||||
Reference in new issue
Block a user