---
name: MyPy

on: [push, pull_request]

jobs:
  mypy:
    name: Run MyPy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Setup reviewdog
        uses: reviewdog/action-setup@v1
        with:
          reviewdog_version: latest

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'
          cache: pip

      - name: Install Python dependencies
        run: |
          python -m pip install --upgrade uv
          uv pip install --system .[mypy]

      - name: Execute MyPy
        uses: tsuyoshicho/action-mypy@v4
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          fail_on_error: true
