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,28 @@ 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 : Check clang-format
28+ run : |
29+ sudo apt-get update
30+ sudo apt-get install -y clang-format
31+
32+ failed_files=$(find src -type f \( -name "*.cpp" -o -name "*.h" \) ! -path "src/lib/fb-api/*" -exec sh -c 'for f; do [ "$(clang-format "$f")" != "$(cat "$f")" ] && echo "$f"; done' _ {} +)
33+
34+ if [ -n "$failed_files" ]; then
35+ echo "The following files are not properly formatted:"
36+ echo "$failed_files"
37+ exit 1
38+ fi
39+
1840 build-linux :
1941 runs-on : ubuntu-latest
2042 steps :
@@ -195,6 +217,7 @@ jobs:
195217 deploy-docs :
196218 runs-on : ubuntu-latest
197219 needs :
220+ - clang-format-check
198221 - build-linux
199222 - build-windows
200223 - 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 : Check clang-format
19+ run : |
20+ sudo apt-get update
21+ sudo apt-get install -y clang-format
22+
23+ failed_files=$(find src -type f \( -name "*.cpp" -o -name "*.h" \) ! -path "src/lib/fb-api/*" -exec sh -c 'for f; do [ "$(clang-format "$f")" != "$(cat "$f")" ] && echo "$f"; done' _ {} +)
24+
25+ if [ -n "$failed_files" ]; then
26+ echo "The following files are not properly formatted:"
27+ echo "$failed_files"
28+ exit 1
29+ fi
30+
931 build-linux :
1032 runs-on : ubuntu-latest
1133 steps :
You can’t perform that action at this time.
0 commit comments