mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-17 16:17:02 +08:00
ci: add automated code style checking
This commit is contained in:
24
.github/workflows/format-check.yml
vendored
Normal file
24
.github/workflows/format-check.yml
vendored
Normal 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
|
||||
Reference in New Issue
Block a user