Add action to populate and save rust dependencies
This commit is contained in:
commit
20293e3263
32
cache-rust-dependencies/action.yaml
Normal file
32
cache-rust-dependencies/action.yaml
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Cache Rust Dependencies
|
||||
description: Fetch and Cache rust dependencies
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
-
|
||||
name: Fetch rust cache
|
||||
id: cache
|
||||
uses: https://github.com/actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry/index
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git/db
|
||||
target/
|
||||
key: cargo-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }}
|
||||
-
|
||||
name: Fetch dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: cargo fetch
|
||||
-
|
||||
name: Populate rust cache
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
uses: https://github.com/actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/registry/index
|
||||
~/.cargo/registry/cache
|
||||
~/.cargo/git/db
|
||||
target/
|
||||
key: ${{ steps.cache.outputs.cache-primary-key }}
|
Loading…
Reference in a new issue