Skip to content

Commit

Permalink
Add support for specifying toolchain profile
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Sep 4, 2023
1 parent 1c10d9b commit 88ee6c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand All @@ -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 }}
4 changes: 2 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ 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
echo "rustup_version=$(rustup --version)" >> $GITHUB_OUTPUT
echo "cargo_version=$(cargo --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"

0 comments on commit 88ee6c7

Please sign in to comment.