-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.05 KB
/
Copy pathcode-quality.yml
File metadata and controls
42 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
name: Code Quality
on:
push:
branches: [main, dev, '**']
pull_request:
branches: [main, dev]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
clang-format:
name: Clang Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check formatting
run: |
# Install clang-format if not available
if ! command -v clang-format &> /dev/null; then
sudo apt-get update
sudo apt-get install -y clang-format
fi
# Find all C++ source files
FAILED=0
for file in $(find . -name '*.hpp' -o -name '*.cc'); do
if ! clang-format --style=file --dry-run "$file" 2>/dev/null; then
echo "Formatting issues found in: $file"
FAILED=1
fi
done
if [ $FAILED -eq 1 ]; then
echo "Some files have formatting issues. Run 'cmake --build . --target format' to fix."
fi