Merge pull request #8 from thomcc/autoinstall-rustup

Attempt to install rustup when not present
This commit is contained in:
David Tolnay 2022-06-04 16:39:58 -07:00 committed by GitHub
commit a8259c0b23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,6 +31,14 @@ runs:
targets: ${{inputs.target}}
components: ${{inputs.components}}
shell: bash
- name: "Install rustup if needed"
run: |
if ! command -v rustup &> /dev/null ; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
echo "${CARGO_HOME:-~/.cargo}/bin" >> $GITHUB_PATH
fi
if: runner.os != 'Windows'
shell: bash
- name: rustup toolchain install ${{inputs.toolchain}}
run: rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
shell: bash