name: QA

on:
  workflow_call:

jobs:
  lint:
    name: Lint (Ruff)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up uv
        uses: astral-sh/setup-uv@v5
        with:
          enable-cache: true
          cache-dependency-glob: "pyproject.toml"

      - name: Install dependencies
        run: uv sync --frozen --group dev

      - name: Run Ruff check
        run: uv run ruff check app/

      - name: Run Ruff format check
        run: uv run ruff format --check app/

  typecheck:
    name: Type Check (Mypy)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up uv
        uses: astral-sh/setup-uv@v5
        with:
          enable-cache: true
          cache-dependency-glob: "pyproject.toml"

      - name: Install dependencies
        run: uv sync --frozen --group dev

      - name: Run Mypy
        run: uv run mypy app/
