name: pre-commit
on:
  pull_request:
    branches: [master]
  push:
    branches: [master]
permissions:
  contents: read
jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-python@v6
        with:
          python-version: "3.x"
      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            libgumbo-dev libfuse3-dev libssl-dev \
            libcurl4-openssl-dev uuid-dev help2man libexpat1-dev pkg-config \
            meson ninja-build astyle clang clang-tidy clang-format \
            fuse3 python3
      - name: Set up build directory
        run: |
          meson setup builddir
      - uses: pre-commit/action@v3.0.1
        with:
          extra_args: --all-files --hook-stage pre-commit
