Skip to content

Commit

Permalink
github: workflows: Update compliance to match what upstream does
Browse files Browse the repository at this point in the history
Downgrade ClangFormat errors to warnings.

Signed-off-by: Johan Hedberg <[email protected]>
  • Loading branch information
jhedberg committed Sep 19, 2024
1 parent 4bd2e0f commit 892c436
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,28 @@ jobs:
exit 1;
fi
warns=("ClangFormat")
files=($($ZEPHYR_BASE/scripts/ci/check_compliance.py -l))
for file in "${files[@]}"; do
f="${file}.txt"
if [[ -s $f ]]; then
errors=$(cat $f)
errors="${errors//'%'/'%25'}"
errors="${errors//$'\n'/'%0A'}"
errors="${errors//$'\r'/'%0D'}"
echo "::error file=${f}::$errors"
exit=1
results=$(cat $f)
results="${results//'%'/'%25'}"
results="${results//$'\n'/'%0A'}"
results="${results//$'\r'/'%0D'}"
if [[ "${warns[@]}" =~ "${file}" ]]; then
echo "::warning file=${f}::$results"
else
echo "::error file=${f}::$results"
exit=1
fi
fi
done
if [ "${exit}" == "1" ]; then
echo "Compliance error, check for error messages in the \"Run Compliance Tests\" step"
echo "You can run this step locally with the ./scripts/ci/check_compliance.py script."
exit 1;
fi

0 comments on commit 892c436

Please sign in to comment.