File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,16 @@ jobs:
6262
6363 - name : count warnings
6464 run : |
65+ set +e
6566 cd build
66- export WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
67+ readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu.log`
6768 echo "include-what-you-use reported ${WARNING_COUNT} warning(s)"
6869 # Acceptable limit, to decrease over time down to 0
69- export WARNING_LIMIT=10
70+ readonly WARNING_LIMIT=10
7071 # FAIL the build if WARNING_COUNT > WARNING_LIMIT
71- exit $(( WARNING_COUNT > WARNING_LIMIT ? 1 : 0 ))
72+ if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
73+ exit 1
74+ # WARN in annotations if WARNING_COUNT > 0
75+ elif [ $WARNING_COUNT -gt 0 ] ; then
76+ echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s)"
77+ fi
You can’t perform that action at this time.
0 commit comments