name: clang-format-check

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  formatting-check:
    name: Formatting Check
    runs-on: ubuntu-latest
    strategy:
      matrix:
        path:
          - "benchmark"
          - "include"
          - "test"
    steps:
      - uses: actions/checkout@v3
      - name: Run clang-format style check for C/C++/Protobuf programs.
        uses: jidicula/clang-format-action@v4.11.0
        with:
          check-path: ${{ matrix.path }}
          fallback-style: "Google"
