ci: add automated code style checking

This commit is contained in:
2026-04-28 09:33:07 +08:00
parent 611a795481
commit f2f00ce658

24
.github/workflows/format-check.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
# .github/workflows/format-check.yml
name: Code Format Check
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format
- name: Check C++ code formatting
run: |
find src include -name "*.cpp" -o -name "*.hpp" | xargs clang-format --dry-run --Werror