Skip to content

Commit c636df1

Browse files
committed
feat(run-pre-commit): Add Rust toolchain caching
1 parent 05fed9d commit c636df1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

run-pre-commit/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,17 @@ runs:
5151
path: ~/.cache/pre-commit
5252
key: pre-commit-${{ inputs.pre-commit-version }}-python${{ inputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
5353

54+
- name: Setup Rust Toolchain Cache
55+
id: rust-toolchain-cache
56+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
57+
if: ${{ inputs.rust }}
58+
with:
59+
path: ~/.rustup/toolchains
60+
key: rust-toolchains-${{ inputs.rust }}-components-${{ inputs.rust-components }}
61+
5462
- name: Setup Rust Toolchain
5563
uses: dtolnay/rust-toolchain@c5a29ddb4d9d194e7c84ec8c3fba61b1c31fee8c
56-
if: ${{ inputs.rust }}
64+
if: ${{ inputs.rust && steps.rust-toolchain-cache.outputs.cache-hit != 'true' }}
5765
with:
5866
toolchain: ${{ inputs.rust }}
5967
components: ${{ inputs.rust-components }}

0 commit comments

Comments
 (0)