name: Style

on:
  push:

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-22.04]
        compiler: [clang]

    runs-on: ${{ matrix.os }}

    steps:
    - name: Environment setup
      uses: actions/checkout@v3
    - name: Install clang-format
      run: sudo apt install clang-format-14
    - name: C style
      env:
        CC: ${{ matrix.compiler }}
        FC: gfortran-11
      run: |
        make info
        make format-c -j2 && git diff --exit-code
