name: Linting

on:
  - push
  - pull_request

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v6
      with:
        fetch-depth: 2
    - name: Install apt dependencies
      run: |
          sudo apt update
          sudo apt install -y libsqlite3-dev liblz4-dev libuv1-dev bear
    - uses: KyleMayes/install-llvm-action@master
      with:
        version: 17
    - name: Run clang-format
      run: |
          find . \( -name '*.c' -or -name '*.h' \) -not -name 'munit.*' -path ./llvm -prune | xargs ./llvm/bin/clang-format --style=file --dry-run -Werror
