Install rustup if not available, Linux only

The original code stems from this PR:
https://github.com/dtolnay/rust-toolchain/pull/8
This commit is contained in:
Jonas Bushart 2022-07-19 18:48:19 +00:00 committed by GitHub
parent 5c0654516c
commit 8ba04cb6f2
2 changed files with 13 additions and 0 deletions

View file

@ -47,6 +47,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