github actions versions check #31
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| # To cancel a currently running workflow from the same PR, branch or tag when a new workflow is triggered | |
| # https://stackoverflow.com/a/72408109 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| # CPU-only torch is sufficient for type checking (avoids ~2GB CUDA download) | |
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| # Install remaining project dependencies | |
| pip install -e ".[dev]" | |
| - name: Lint with ruff | |
| id: ruff | |
| run: ruff check lightning_action tests | |
| - name: Show fix instructions if linting failed | |
| if: always() && steps.ruff.outcome == 'failure' | |
| run: | | |
| echo "" | |
| echo "Linting failed!" | |
| echo "" | |
| echo "To auto-fix issues locally, run:" | |
| echo " ruff check --fix lightning_action tests" | |
| echo "" | |
| echo "To see all violations without fixing, run:" | |
| echo " ruff check lightning_action tests" | |
| echo "" | |
| - name: Type check with pyright | |
| id: pyright | |
| run: pyright | |
| - name: Show fix instructions if type checking failed | |
| if: always() && steps.pyright.outcome == 'failure' | |
| run: | | |
| echo "" | |
| echo "Type checking failed!" | |
| echo "" | |
| echo "To reproduce locally, run:" | |
| echo " pyright" | |
| echo "" |