File tree 1 file changed +32
-0
lines changed
1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Code Formatter
2
+
3
+ # run on pull requests to develop
4
+ on :
5
+ pull_request
6
+
7
+ jobs :
8
+ format :
9
+ name : Clang Formatter
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ with :
14
+ ref : ${{ github.head_ref }}
15
+ # fetch everything to be able to compare with any ref
16
+ fetch-depth : 0
17
+
18
+ - name : Check
19
+ env :
20
+ LANG : " C.UTF-8"
21
+ LC_ALL : " C.UTF-8"
22
+ LANGUAGE : " C.UTF-8"
23
+ run : |
24
+ sudo apt-get install -y clang-format-14 python3 git
25
+ diff_output_file=$(mktemp)
26
+ git --no-pager diff -U0 --diff-filter=ACMRT ${{github.event.pull_request.base.sha}} ${{ github.event.pull_request.head.sha }} | clang-format-diff-14 -p1 2>&1 | tee $diff_output_file
27
+ if [ -s $diff_output_file ]; then
28
+ exit 1
29
+ else
30
+ exit 0
31
+ fi
32
+
You can’t perform that action at this time.
0 commit comments