42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Setup Rust
|
|
description: Setup Rust
|
|
inputs:
|
|
target:
|
|
description: Toolchain target triple
|
|
required: false
|
|
save-cache:
|
|
description: Whether or not to save the rust cache
|
|
required: false
|
|
default: 'false'
|
|
restore-cache:
|
|
description: Whether or not to restore the rust cache
|
|
required: false
|
|
default: 'true'
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Install Rust Stable
|
|
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
|
|
with:
|
|
toolchain: stable
|
|
targets: ${{ inputs.target }}
|
|
components: clippy, rustfmt
|
|
|
|
- name: Install Rust Nightly
|
|
uses: dtolnay/rust-toolchain@7b1c307e0dcbda6122208f10795a713336a9b35a
|
|
with:
|
|
toolchain: nightly
|
|
targets: ${{ inputs.target }}
|
|
components: clippy, rustfmt
|
|
|
|
- name: Cache Rust
|
|
if: ${{ inputs.restore-cache == 'true' }}
|
|
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
|
|
with:
|
|
key: ${{ inputs.target }}
|
|
save-if: ${{ inputs.save-cache }}
|
|
shared-key: stable-cache
|
|
|
|
- name: Prepare Cargo
|
|
shell: bash
|
|
run: echo '{}' | npx -y mustache - .cargo/config.toml.mustache .cargo/config.toml
|