Add support for specifying toolchain profile

This commit is contained in:
Héctor Ramón Jiménez 2023-09-04 15:15:56 +02:00
parent 1c10d9b9ac
commit 88ee6c71a6
No known key found for this signature in database
GPG Key ID: 140CC052C94F138E
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,9 @@ inputs:
rust-version:
description: The toolchain version; such as stable, nightly, or 1.8.0
default: stable
profile:
description: The toolchain profile to install
default: default
components:
description: The toolchain components to install, comma-separated
default: ""
@ -22,5 +25,6 @@ runs:
shell: bash
env:
INPUT_RUST_VERSION: ${{ inputs.rust-version }}
INPUT_PROFILE: ${{ inputs.profile }}
INPUT_COMPONENTS: ${{ inputs.components }}
INPUT_TARGETS: ${{ inputs.targets }}

View File

@ -12,7 +12,7 @@ args=()
# shellcheck disable=SC2206
[[ -n "${INPUT_TARGETS}" ]] && args+=(-t "${INPUT_TARGETS// /}")
rustup toolchain install "${INPUT_RUST_VERSION}" "${args[@]}"
rustup toolchain install "${INPUT_RUST_VERSION}" --profile "${INPUT_PROFILE}" "${args[@]}"
rustup default "${INPUT_RUST_VERSION}"
# shellcheck disable=SC2129