Skip to content

Commit

Permalink
feat: Add a pre-commit cache to the test-code and update-python-and-p…
Browse files Browse the repository at this point in the history
…re-commit-dependencies reusable workflows
  • Loading branch information
nfelt14 committed Aug 27, 2024
1 parent d216c5f commit 5c6435c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/_reusable-test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5c6435c

Please sign in to comment.