Update test-tensorflow-switching.yml #6
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: Pylint | |
| on: [push, pull_request] | |
| jobs: | |
| pylint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| # === FIX 1: Only list Python versions you actually support === | |
| python-version: ["3.10", "3.11", "3.12"] # Added 3.12 as well, as you support it | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install your project dependencies | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install pylint | |
| - name: Analysing the code with pylint | |
| run: | | |
| # === FIX 2: Make the check meaningful. Fail if the score is below 9/10 === | |
| # This will make the workflow fail if code quality drops. | |
| find . -type f -name "*.py" | xargs pylint --fail-under=9 | |
| - name: Generate pylint report (only if analysis fails) | |
| # This step will only run if the previous step failed, so you can see the report | |
| if: failure() | |
| run: | | |
| find . -type f -name "*.py" | xargs pylint --output-format=text --reports=yes > pylint-report.txt || true | |
| - name: Upload pylint report (only if analysis fails) | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pylint-report-${{ matrix.python-version }} | |
| path: pylint-report.txt |