Skip to content

Commit cd292e2

Browse files
update clang-format-check.yml for clang-format 21.1.0
1 parent 82d78a8 commit cd292e2

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

.github/workflows/clang-format-check.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,21 @@ jobs:
88
matrix:
99
path:
1010
- check: 'src'
11-
exclude: 'third_party' # Exclude file paths containing "hello" or "world"
11+
exclude: 'third_party'
1212
- check: 'tests'
13-
exclude: '' # Nothing to exclude
13+
exclude: ''
1414
steps:
1515
- uses: actions/checkout@v3
16-
- name: Run clang-format style check for C/C++/Protobuf programs.
17-
uses: jidicula/clang-format-action@v4.11.0
18-
with:
19-
clang-format-version: '13'
20-
check-path: ${{ matrix.path['check'] }}
21-
exclude-regex: ${{ matrix.path['exclude'] }}
22-
fallback-style: 'Microsoft' # optional
16+
17+
- name: Install clang-format 21.1.0
18+
run: |
19+
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-21.1.0/clang+llvm-21.1.0-x86_64-linux-gnu-ubuntu-22.04.tar.xz
20+
tar -xf clang+llvm-21.1.0-x86_64-linux-gnu-ubuntu-22.04.tar.xz
21+
sudo cp clang+llvm-21.1.0-x86_64-linux-gnu-ubuntu-22.04/bin/clang-format /usr/local/bin/
22+
clang-format --version
23+
24+
- name: Run clang-format check
25+
run: |
26+
find ${{ matrix.path.check }} -name "*.cpp" -o -name "*.hpp" -o -name "*.cc" -o -name "*.c" -o -name "*.h" -o -name "*.proto" | \
27+
grep -v "${{ matrix.path.exclude }}" | \
28+
xargs clang-format --dry-run --Werror --style=file --fallback-style=Microsoft

0 commit comments

Comments
 (0)