diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bd0f806b0..4e2a2db26 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: name: Get changed files outputs: any_docs_changed: ${{ steps.changed-doc-files.outputs.any_changed }} - any_python_changed: ${{ steps.changed-python-files.outputs.any_changed }} + any_python_changed: ${{ steps.raw-changed-python-files.outputs.any_changed }} changed_doc_files: ${{ steps.changed-doc-files.outputs.all_changed_files }} changed_python_files: ${{ steps.changed-python-files.outputs.all_changed_files }} steps: @@ -27,13 +27,24 @@ jobs: files: | docs/** - name: Get changed python files - id: changed-python-files + id: raw-changed-python-files uses: tj-actions/changed-files@v44 with: files: | **.py poetry.lock + - name: Check changed python files + id: changed-python-files + env: + CHANGED_PYTHON_FILES: ${{ steps.raw-changed-python-files.outputs.all_changed_files }} + run: | + if [[ " $CHANGED_PYTHON_FILES " == *" poetry.lock "* ]]; then + # if poetry.lock is changed, we need to check everything + CHANGED_PYTHON_FILES="." + fi + echo "all_changed_files=$CHANGED_PYTHON_FILES" >> "$GITHUB_OUTPUT" + format: if: needs.changed-files.outputs.any_python_changed == 'true' runs-on: ubuntu-latest diff --git a/docs/changelog.rst b/docs/changelog.rst index a245cc623..b970f5ee5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -34,6 +34,10 @@ Other changes: docs checks now live in separate jobs and are named accordingly. * Added caching for dependency installation in all CI jobs which speeds them up a bit, especially the tests. +* The linting workflow has been made to run only when Python files or + documentation is changed, and they only check the changed files. When + dependencies are updated (``poetry.lock``), then the entire code base is + checked. 2.0.0 (May 30, 2024) --------------------