File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check formatting
2+
3+ on :
4+ push :
5+ branches :
6+ - ' main'
7+ - ' development'
8+ pull_request :
9+ branches :
10+ - ' main'
11+ - ' development'
12+
13+ jobs :
14+ clang-format :
15+ # The exact version doesn't really matter, as we're getting a build from LLVM repos anyway
16+ runs-on : [ ubuntu-latest ]
17+
18+ env :
19+ CLANG_MAJOR_VERSION : 20
20+
21+ steps :
22+ - name : Checkout repository
23+ uses : actions/checkout@v4
24+
25+ - name : Install Clang Format
26+ run : |
27+ wget https://apt.llvm.org/llvm.sh
28+ sudo chmod +x llvm.sh
29+ sudo ./llvm.sh $CLANG_MAJOR_VERSION
30+ sudo apt-get install clang-format-$CLANG_MAJOR_VERSION
31+
32+ - name : Print clang-format version
33+ run : clang-format-$CLANG_MAJOR_VERSION --version
34+
35+ - name : Run Clang Format
36+ run : |
37+ find . -name '*.cpp' -o -name '*.hpp' -o -name '*.c' -o -name '*.h' | xargs clang-format-$CLANG_MAJOR_VERSION -i
38+ git diff --exit-code || (echo "The changes are not formatted properly" && exit 1)
You can’t perform that action at this time.
0 commit comments