File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,24 @@ concurrency:
1515 group : main
1616
1717jobs :
18+ clang-format-check :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout repository
22+ uses : actions/checkout@v4
23+ with :
24+ submodules : recursive
25+ fetch-depth : 0
26+
27+ - name : Install clang-format
28+ run : |
29+ sudo apt-get update
30+ sudo apt-get install -y clang-format
31+
32+ - name : Check clang-format
33+ run : |
34+ ./check-format.sh
35+
1836 build-linux :
1937 runs-on : ubuntu-latest
2038 steps :
@@ -195,6 +213,7 @@ jobs:
195213 deploy-docs :
196214 runs-on : ubuntu-latest
197215 needs :
216+ - clang-format-check
198217 - build-linux
199218 - build-windows
200219 - build-macos
Original file line number Diff line number Diff line change 66 - main
77
88jobs :
9+ clang-format-check :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout repository
13+ uses : actions/checkout@v4
14+ with :
15+ submodules : recursive
16+ fetch-depth : 0
17+
18+ - name : Install clang-format
19+ run : |
20+ sudo apt-get update
21+ sudo apt-get install -y clang-format
22+
23+ - name : Check clang-format
24+ run : |
25+ ./check-format.sh
26+
927 build-linux :
1028 runs-on : ubuntu-latest
1129 steps :
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ failed_files=$( \
4+ find src -type f \( -name " *.cpp" -o -name " *.h" \) ! -path " src/lib/fb-api/*" \
5+ -exec sh -c ' for f; do [ "$(clang-format "$f")" != "$(cat "$f")" ] && echo "$f"; done' _ {} +)
6+
7+ if [ -n " $failed_files " ]; then
8+ echo " The following files are not properly formatted:"
9+ echo " $failed_files "
10+ exit 1
11+ fi
You can’t perform that action at this time.
0 commit comments