Skip to content

Commit 2935fbc

Browse files
committed
chore(workflows): add caching for pre-commit in cache-warmup and pre-commit workflows
1 parent d454c85 commit 2935fbc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.github/workflows/cache-warmup.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,14 @@ jobs:
4343
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}
4444
with:
4545
asdf_version: ${{ env.ASDF_VERSION }}
46+
47+
- name: Cache pre-commit
48+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
49+
with:
50+
path: ~/.cache/pre-commit
51+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}}}
52+
53+
- name: Run pre-commit
54+
run: pre-commit install --install-hooks
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # required for GH API calls quota

.github/workflows/pre-commit.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ jobs:
5555
shell: bash
5656
run: asdf reshim
5757

58+
- name: Cache pre-commit
59+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
60+
with:
61+
path: ~/.cache/pre-commit
62+
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}}}
63+
5864
- name: Run pre-commit
5965
run: pre-commit run --show-diff-on-failure --color=always --all-files
6066
env:

0 commit comments

Comments
 (0)