diff --git a/.github/workflows/clang-format-check.yml b/.github/workflows/clang-format-check.yml new file mode 100644 index 0000000..a8226a0 --- /dev/null +++ b/.github/workflows/clang-format-check.yml @@ -0,0 +1,30 @@ +name: clang-format Check +on: + push: + branches: + - main + - develop + pull_request: + paths: + - '**.[ch]pp' + - '**.[ch]' + - '.github/**' + workflow_dispatch: + +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + strategy: + matrix: + path: + - 'src' + - 'examples' + steps: + - uses: actions/checkout@v4 + - name: Run clang-format style check for C/C++/Protobuf programs. + uses: jidicula/clang-format-action@v4.13.0 + with: + clang-format-version: '13' + check-path: ${{ matrix.path }} + fallback-style: 'Mozilla' # optional diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml deleted file mode 100644 index 523f48e..0000000 --- a/.github/workflows/code-style.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Code Style -on: - push: - branches: - - main - - develop - pull_request: - paths: - - '**.[ch]pp' - - '**.[ch]' - - '.github/**' - workflow_dispatch: - -jobs: - formatting: - runs-on: ubuntu-latest - steps: - - name: Checkout FANS - uses: actions/checkout@v4 - - name: Setup python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - check-latest: true - - name: Install pre-commit - run: pip install pre-commit - - name: Run checks - run: pre-commit run -a -v - - name: Git status - if: always() - run: git status - - name: Full diff - if: always() - run: git diff