name: Clang-Format

on:
  workflow_call:

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Ensure git safe directory
        run: |
          git config --global --add safe.directory $(pwd)
      - name: Install clang-format-15
        run: |
          sudo apt update
          sudo apt install clang-format-15
      - name: Run clang-format
        run: |
          bash ./.github/scripts/clang-format.sh `which clang-format-15`
