Skip to content

Commit cafa1d6

Browse files
shijiashuaiqwencoder
andcommitted
ci: update clang-format to v18 to match local environment
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent e125eab commit cafa1d6

1 file changed

Lines changed: 5 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -30,42 +30,12 @@ jobs:
3030
- name: Checkout
3131
uses: actions/checkout@v4
3232

33-
- name: Install clang-format
34-
run: |
35-
sudo apt-get update
36-
sudo apt-get install -y clang-format-17
37-
sudo ln -sf /usr/bin/clang-format-17 /usr/bin/clang-format
38-
3933
- name: Check C/C++/CUDA formatting
40-
run: |
41-
echo "Running clang-format check..."
42-
43-
# Find all C/C++/CUDA files, excluding build and third-party directories
44-
FILES=$(find . -type f \( -name "*.cpp" -o -name "*.hpp" -o -name "*.cu" -o -name "*.cuh" \) \
45-
! -path "./build/*" \
46-
! -path "./third_party/*" \
47-
! -path "./external/*" \
48-
! -path "./vendor/*" \
49-
! -path "./.git/*" \
50-
! -path "./docs/*" \
51-
! -path "./examples/*")
52-
53-
# Check formatting
54-
FAIL=0
55-
for FILE in $FILES; do
56-
if ! clang-format --dry-run --Werror "$FILE" 2>/dev/null; then
57-
echo "✗ Formatting issue in $FILE"
58-
FAIL=1
59-
fi
60-
done
61-
62-
if [ $FAIL -eq 1 ]; then
63-
echo ""
64-
echo "✗ Format check failed. Please run clang-format on the above files."
65-
exit 1
66-
fi
67-
68-
echo "✓ All files pass formatting check"
34+
uses: jidicula/clang-format-action@v4.14.0
35+
with:
36+
clang-format-version: '18'
37+
check-path: '.'
38+
exclude-regex: '(^|/)(build|third_party|external|vendor|\.git|docs|examples)(/|$)'
6939

7040
docs-consistency:
7141
name: Documentation Consistency

0 commit comments

Comments
 (0)