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

View File

@ -12,7 +12,7 @@ args=()
# shellcheck disable=SC2206 # shellcheck disable=SC2206
[[ -n "${INPUT_TARGETS}" ]] && args+=(-t "${INPUT_TARGETS// /}") [[ -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}" rustup default "${INPUT_RUST_VERSION}"
# shellcheck disable=SC2129 # shellcheck disable=SC2129
@ -20,4 +20,4 @@ echo "rustup_version=$(rustup --version)" >> $GITHUB_OUTPUT
echo "cargo_version=$(cargo --version)" >> $GITHUB_OUTPUT echo "cargo_version=$(cargo --version)" >> $GITHUB_OUTPUT
echo "rustc_version=$(rustc --version)" >> $GITHUB_OUTPUT echo "rustc_version=$(rustc --version)" >> $GITHUB_OUTPUT
echo "::add-matcher::${GITHUB_ACTION_PATH%/}/matcher.json" echo "::add-matcher::${GITHUB_ACTION_PATH%/}/matcher.json"