Cache rust toolchain in setup-rust action
This commit is contained in:
14
.github/actions/setup-rust/action.yml
vendored
14
.github/actions/setup-rust/action.yml
vendored
@@ -37,6 +37,19 @@ runs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
|
- name: Sanitize components input
|
||||||
|
shell: bash
|
||||||
|
run: echo "SANITIZED_COMPONENTS=${{ inputs.components }}" | sed -E 's/, ?| /-/g' >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Cache Rust toolchain
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.rustup
|
||||||
|
# Key includes the OS and the toolchain version (e.g., 'stable')
|
||||||
|
key: ${{ runner.os }}-rustup-${{ hashFiles('rust-toolchain.toml') }}-v1-${{ inputs.toolchain }}-${{ env.SANITIZED_COMPONENTS }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-rustup-
|
||||||
|
|
||||||
- name: Cache cargo build (target)
|
- name: Cache cargo build (target)
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
@@ -44,7 +57,6 @@ runs:
|
|||||||
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
|
||||||
- name: Set up rust toolchain
|
- name: Set up rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user