mirror of
https://github.com/netdata/libbpf.git
synced 2026-03-26 03:09:07 +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:
committed by
Andrii Nakryiko
parent
4374bad784
commit
7f11cd48d6
@@ -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