File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed
Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -277,6 +277,8 @@ jobs:
277277 psv-formatting-checker :
278278 name : PSV.Clang.Format.Checker
279279 runs-on : ubuntu-22.04
280+ env :
281+ CLANG_FORMAT_FILE : " clang-format.diff"
280282 steps :
281283 - name : Check out repository
282284 uses : actions/checkout@v4
@@ -300,3 +302,15 @@ jobs:
300302 - name : " Clang format checker script"
301303 run : ./scripts/misc/clang_format_ci.sh
302304 shell : bash
305+ - name : Store formatting check results
306+ uses : actions/upload-artifact@v4
307+ with :
308+ name : clang-format-diff
309+ path : ${{ env.CLANG_FORMAT_FILE }}
310+ - name : Verify check result
311+ run : |
312+ set +x
313+ if [ -s ${CLANG_FORMAT_FILE} ] ; then
314+ exit 1
315+ fi
316+ shell : bash
Original file line number Diff line number Diff line change @@ -48,3 +48,24 @@ if [ -z "$FILES" ]; then
4848else
4949 printf " Affected files:\n %s\n" " $FILES "
5050fi
51+
52+ printf " \n\n### Running clang-format - START ### \n\n"
53+
54+ clang-format-6.0 -i ${FILES}
55+ RESULT=$?
56+
57+ printf " \n\n### Running clang-format - DONE ### \n\n"
58+
59+ if [ " $RESULT " -ne " 0" ]; then
60+ printf " \n\nClang-format failed!\n\n"
61+ OVERALL_RESULT=$RESULT
62+ continue
63+ fi
64+
65+ CLANG_FORMAT_FILE=${CLANG_FORMAT_FILE:- clang-format.diff}
66+ git diff > ${CLANG_FORMAT_FILE}
67+ if [ -s ${CLANG_FORMAT_FILE} ] ; then
68+ printf " \nFormatting errors found, please check them!\n\n"
69+ fi
70+
71+ exit ${OVERALL_RESULT}
You can’t perform that action at this time.
0 commit comments