---
name: Typing

# yamllint disable-line rule:truthy
on:
  push:
    branches:
      - main
    paths:
      - "**.py"
      - "pyproject.toml"
      - "uv.lock"
      - "pypaperless/**"
      - "tests/**"
  pull_request:
    paths:
      - "**.py"
      - "pyproject.toml"
      - "uv.lock"
      - "pypaperless/**"
      - "tests/**"
  workflow_dispatch:

env:
  DEFAULT_PYTHON: "3.13"

jobs:
  mypy:
    name: mypy
    runs-on: ubuntu-latest
    steps:
      - name: ⤵️ Check out code from GitHub
        uses: actions/checkout@v4.2.2
      - name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
        id: python
        uses: actions/setup-python@v5.6.0
        with:
          python-version: ${{ env.DEFAULT_PYTHON }}
      - name: 🏗 Set up uv
        run: |
          pipx install uv
          uv venv
      - name: 🏗 Install Python dependencies
        run: uv sync --group dev
      - name: 🚀 Run mypy
        run: uv run mypy pypaperless tests
