name: PR Checks

on:
  pull_request:
    branches: [ main ]  

jobs:
  typecheck:
    name: Run Typecheck
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version-file: "pyproject.toml"
    - name: Install uv
      uses: astral-sh/setup-uv@v6
    - name: Install dependencies
      run: uv sync --dev
    - name: Setup just
      uses: extractions/setup-just@v3
    - name: Run typecheck
      run: just typecheck

  format:
    name: Run Format Check
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Set up Python
      uses: actions/setup-python@v5
      with:
        python-version-file: "pyproject.toml"
    - name: Install uv
      uses: astral-sh/setup-uv@v6
    - name: Install dependencies
      run: uv sync --dev
    - name: Setup just
      uses: extractions/setup-just@v3
    - name: Run format
      run: just format-check
