name: Python Type Check and Lint

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  ci:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup uv
        uses: astral-sh/setup-uv@v5
        with:
          enable-cache: true

      - name: "Set up Python"
        run: uv python install

      - name: Install dependencies
        run: uv sync --all-groups

      - name: Run Type Check (mypy)
        run: uv run mypy .

      - name: Run Lint & Format Check (ruff)
        run: |
          uv run ruff check .
          uv run ruff format --check .