mirror of
https://github.com/serai-dex/serai.git
synced 2024-10-31 09:27:37 +00:00
95aa1ab827
Apparently, GitHub doesn't write back to the cache, leading to massive build times a few moments after its initialization (when a change happens invalidating it). While this forces a new cache whenever dependencies change, it'll restore from an older set of dependencies in that case, still minimizing build times.
34 lines
905 B
YAML
34 lines
905 B
YAML
name: cached-rust
|
|
description: Installs Rust, caching ~/.cargo and ./target
|
|
|
|
inputs:
|
|
toolchain:
|
|
description: "Toolchain to install"
|
|
required: false
|
|
default: stable
|
|
|
|
components:
|
|
description: "Components to install"
|
|
required: false
|
|
default:
|
|
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Rust Cache
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
./target
|
|
key: ${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.install-rust.outputs.rustc_hash }}-${{ hashFiles("**/Cargo.lock") }}
|
|
restore-keys: ${{ runner.os }}-${{ runner.arch }}-rust-${{ steps.install-rust.outputs.rustc_hash }}-
|
|
|
|
- name: Install Rust
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
toolchain: ${{ inputs.toolchain }}
|
|
profile: minimal
|
|
default: true
|
|
components: ${{ inputs.components }}
|