diff --git a/.github/workflows/_reusable-test-code.yml b/.github/workflows/_reusable-test-code.yml index 5d1e0192..a8f33076 100644 --- a/.github/workflows/_reusable-test-code.yml +++ b/.github/workflows/_reusable-test-code.yml @@ -50,6 +50,12 @@ jobs: check-latest: true - name: Install dependencies run: python -m pip install tox tox-gh-actions + - name: Set up pre-commit cache + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') + }} - name: Run tox run: tox -v - uses: actions/upload-artifact@v4 diff --git a/.github/workflows/_reusable-update-python-and-pre-commit-dependencies.yml b/.github/workflows/_reusable-update-python-and-pre-commit-dependencies.yml index bd75d04d..ff1921e6 100644 --- a/.github/workflows/_reusable-update-python-and-pre-commit-dependencies.yml +++ b/.github/workflows/_reusable-update-python-and-pre-commit-dependencies.yml @@ -77,6 +77,13 @@ jobs: passphrase: ${{ secrets.gpg-signing-key-passphrase }} git_user_signingkey: true git_commit_gpgsign: true + - name: Set up pre-commit cache + if: ${{ inputs.update-pre-commit || inputs.run-pre-commit }} + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') + }} - if: ${{ endsWith(github.repository, '/python-package-ci-cd') }} # Run the local action when this is run in the python-package-ci-cd repository uses: ./actions/update_development_dependencies with: