-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
49 lines (47 loc) · 1.26 KB
/
action.yml
File metadata and controls
49 lines (47 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: Setup Rust
description: Set up rust and rust-cache.
inputs:
toolchain:
description: Toolchain name.
default: stable
required: true
profile:
description: Rustup profile.
default: minimal
required: true
components:
description: Comma separated list of additional components.
required: false
use-cache:
description: Use rust-cache.
default: true
required: true
cache-key:
description: Additional cache key for rust-cache.
required: false
workspaces:
description: Cargo workspaces for rust-cache.
required: false
runs:
using: composite
steps:
- name: Install Rust
run: |
set -- "$TOOLCHAIN" --profile "$PROFILE"
if [[ -n "$COMPONENTS" ]]; then
set -- "$@" --component "$COMPONENTS"
fi
set -x
rustup toolchain install "$@" --no-self-update
rustup default "$TOOLCHAIN"
env:
TOOLCHAIN: ${{ inputs.toolchain }}
PROFILE: ${{ inputs.profile }}
COMPONENTS: ${{ inputs.components }}
shell: bash
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
key: ${{ inputs.cache-key }}
workspaces: ${{ inputs.workspaces }}
if: inputs.use-cache == 'true'