2695-Completed_files-set_status #612
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: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| permissions: | |
| contents: read | |
| jobs: | |
| ruff-changes-in-file: | |
| runs-on: ubuntu-latest | |
| name: ruff run | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Ruff | |
| run: pip install ruff | |
| - name: Run Ruff | |
| run: ruff check $(git diff --name-only --cached -- '*.py') | |
| mypy-changes-in-file: | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| name: mypy run | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - run: pip install mypy | |
| - run: python3 -m pip install types-requests | |
| - name: Get Python changed files | |
| id: changed-py-files | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: | | |
| *.py | |
| **/*.py | |
| - name: Run if any of the listed files above is changed | |
| if: steps.changed-py-files.outputs.any_changed == 'true' | |
| run: mypy --follow-imports=skip ${{ steps.changed-py-files.outputs.all_changed_files }} --ignore-missing-imports |