name: CI

on:
  pull_request:
    branches: [master]

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6.0.2

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          cache-dependency-glob: |
            **/pyproject.toml
          python-version: 3.13
      - name: Run pre-commit
        run: uv run pre-commit run --all-files

  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6.0.2

      - name: Install uv
        uses: astral-sh/setup-uv@v7
        with:
          cache-dependency-glob: |
            **/pyproject.toml
          python-version: 3.13
      - name: Run tests
        run: uv run pytest
