mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2025-07-04 12:31:11 +00:00
Allow overriding the toolchain file
This commit is contained in:
parent
317ed62323
commit
5ea736b97f
2 changed files with 13 additions and 7 deletions
14
action.yml
14
action.yml
|
@ -15,7 +15,6 @@ inputs:
|
|||
toolchain:
|
||||
description: "Rust toolchain specification -- see https://rust-lang.github.io/rustup/concepts/toolchains.html#toolchain-specification"
|
||||
required: false
|
||||
default: "stable"
|
||||
target:
|
||||
description: "Target triple to install for this toolchain"
|
||||
required: false
|
||||
|
@ -107,9 +106,9 @@ runs:
|
|||
fi
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
- name: rustup toolchain install ${{inputs.toolchain}}
|
||||
- name: rustup toolchain install ${{inputs.toolchain || 'stable'}}
|
||||
run: |
|
||||
if [[ -f "rust-toolchain" || -f "rust-toolchain.toml" ]]
|
||||
if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml" ) ]]
|
||||
then
|
||||
# Install the toolchain as specified in the file
|
||||
# Might break at some point: https://github.com/rust-lang/rustup/issues/1397
|
||||
|
@ -121,10 +120,15 @@ runs:
|
|||
rustup target add ${targets//,/ }
|
||||
fi
|
||||
else
|
||||
rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
|
||||
rustup default ${{inputs.toolchain}}
|
||||
if [[ -z "$toolchain" ]]
|
||||
then
|
||||
toolchain=stable
|
||||
fi
|
||||
rustup toolchain install $toolchain${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
|
||||
rustup default $toolchain
|
||||
fi
|
||||
env:
|
||||
toolchain: ${{inputs.toolchain}}
|
||||
targets: ${{inputs.target}}
|
||||
components: ${{inputs.components}}
|
||||
shell: bash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue