diff options
author | Nate Kidwell <ludicast@users.noreply.github.com> | 2022-06-17 16:33:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 22:33:53 +0200 |
commit | ead0498fb78077d63c9aa5c8969a05ca28e800bd (patch) | |
tree | a4871254054aba279c4ffbb8f8a52a668d6fcd0a /.github/actions/setup | |
parent | 5cdffd6e0e9eb0a408cec6e5a143231e139970fe (diff) | |
download | askama-ead0498fb78077d63c9aa5c8969a05ca28e800bd.tar.gz askama-ead0498fb78077d63c9aa5c8969a05ca28e800bd.tar.bz2 askama-ead0498fb78077d63c9aa5c8969a05ca28e800bd.zip |
Add caching action to shrink CI times (#698)
Diffstat (limited to '')
-rw-r--r-- | .github/actions/setup/action.yml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..c2d9be5 --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,35 @@ +name: Setup Rust Environment + +inputs: + key: + description: Cache key + required: true + toolchain: + description: Pass-through to toolchain on actions-rs + default: stable + required: false + components: + description: Pass-through to components on actions-rs + required: false + +runs: + using: composite + steps: + - uses: actions-rs/toolchain@v1 + id: toolchain-install + with: + profile: minimal + override: true + toolchain: ${{ inputs.toolchain }} + components: ${{ inputs.components }} + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ inputs.key }}-${{ runner.os }}-${{ inputs.toolchain }}-${{ steps.toolchain-install.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }} + restore-keys: | + ${{ inputs.key }}-${{ runner.os }}-${{ inputs.toolchain }}-${{ steps.toolchain-install.outputs.rustc_hash }}- + ${{ inputs.key }}-${{ runner.os }}-${{ inputs.toolchain }}- |