Merge pull request #15753 from miri64/dist/enh/vera++-annotate
dist/tools/vera++: annotate errors in Github Action
This commit is contained in:
commit
3c688e31ad
37
dist/tools/vera++/check.sh
vendored
37
dist/tools/vera++/check.sh
vendored
@ -12,6 +12,7 @@ CURDIR=$(cd "$(dirname "$0")" && pwd)
|
|||||||
: "${WARNING:=1}"
|
: "${WARNING:=1}"
|
||||||
|
|
||||||
. "$RIOTBASE"/dist/tools/ci/changed_files.sh
|
. "$RIOTBASE"/dist/tools/ci/changed_files.sh
|
||||||
|
. "$RIOTBASE"/dist/tools/ci/github_annotate.sh
|
||||||
# tests/pkg_utensor/models/deep_mlp_weight.hpp is an auto-generated file
|
# tests/pkg_utensor/models/deep_mlp_weight.hpp is an auto-generated file
|
||||||
# with lots of commas so T009 takes very long. Since it is auto-generated, just
|
# with lots of commas so T009 takes very long. Since it is auto-generated, just
|
||||||
# exclude it.
|
# exclude it.
|
||||||
@ -29,5 +30,39 @@ fi
|
|||||||
|
|
||||||
VERA_CMD="vera++ --root $CURDIR --exclusions $CURDIR/exclude $_QUIET"
|
VERA_CMD="vera++ --root $CURDIR --exclusions $CURDIR/exclude $_QUIET"
|
||||||
|
|
||||||
|
# sets
|
||||||
|
# - LOG to tee output into for later parsing
|
||||||
|
# - LOGFILE to parse GitHub annotations into
|
||||||
|
github_annotate_setup
|
||||||
|
|
||||||
|
RESULT=0 # remove if script should error
|
||||||
|
|
||||||
echo "$FILES" | $VERA_CMD --profile riot \
|
echo "$FILES" | $VERA_CMD --profile riot \
|
||||||
--parameters $CURDIR/profiles/riot_params.txt -w
|
--parameters $CURDIR/profiles/riot_params.txt -w 2>&1 | ${LOG}
|
||||||
|
# Uncomment when the script should error
|
||||||
|
# RESULT=${PIPESTATUS[0]}
|
||||||
|
|
||||||
|
if github_annotate_is_on; then
|
||||||
|
_annotate() {
|
||||||
|
FILENAME=$(echo "${line}" | cut -d: -f1)
|
||||||
|
LINENUM=$(echo "${line}" | cut -d: -f2)
|
||||||
|
DETAILS=$(echo "${line}" | cut -d: -f3- |
|
||||||
|
sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
|
||||||
|
|
||||||
|
# parse if warning (errors don't have a label)
|
||||||
|
if echo "$DETAILS" | grep -q "^warning: "; then
|
||||||
|
DETAILS=$(echo "$DETAILS" | sed 's/^warning: //')
|
||||||
|
github_annotate_warning "$FILENAME" "$LINENUM" "$DETAILS"
|
||||||
|
else
|
||||||
|
# errors might start with "error:" (but don't have to)
|
||||||
|
DETAILS=$(echo "$DETAILS" | sed 's/^error: //')
|
||||||
|
github_annotate_error "$FILENAME" "$LINENUM" "$DETAILS"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
github_annotate_parse_log_default _annotate
|
||||||
|
fi
|
||||||
|
|
||||||
|
github_annotate_teardown
|
||||||
|
|
||||||
|
exit ${RESULT}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user