diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 0000000..ee21990 --- /dev/null +++ b/.github/workflows/format-check.yml @@ -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