name: clang-format
on: [push, pull_request]
concurrency:
  group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
  cancel-in-progress: true
jobs:
  formatting-check:
    name: Format check
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Run clang-format style check for C/C++ programs.
      uses: jidicula/clang-format-action@v4.2.0
      with:
        clang-format-version: '13'
        exclude-regex: 'doctest.h'
