name: clang-format check

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  formatting-check:
    name: Formatting Check of ${{ github.workspace }}/${{ matrix.path }} directory
    runs-on: ubuntu-latest
    strategy:
      matrix:
        path:
          - 'src'
          - 'include'
          - 'unit_test'
          - 'standalone'
    steps:
    - uses: actions/checkout@v3
    - name: Run clang-format style check for C/C++/Protobuf programs.
      uses: jidicula/clang-format-action@v4.9.0
      with:
        clang-format-version: '16'
        check-path: ${{ github.workspace }}/${{ matrix.path }}
