Skip to content

Commit 8ba04cb

Browse files
authored
Install rustup if not available, Linux only
The original code stems from this PR: dtolnay/rust-toolchain#8
1 parent 5c06545 commit 8ba04cb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
* Install rustup if not available in the CI environment. (Linux only)
13+
The code is taken from this issue: <https://github.com/dtolnay/rust-toolchain/pull/8>
14+
1015
## [1.0.1] - 2022-04-20
1116

1217
### Added

action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ runs:
4747
targets: ${{inputs.target}}
4848
components: ${{inputs.components}}
4949
shell: bash
50+
- name: Install rustup, if needed
51+
run: |
52+
if ! command -v rustup &> /dev/null ; then
53+
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
54+
echo "${CARGO_HOME:-~/.cargo}/bin" >> $GITHUB_PATH
55+
fi
56+
if: runner.os != 'Windows'
57+
shell: bash
5058
- name: rustup toolchain install ${{inputs.toolchain}}
5159
run: |
5260
rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update

0 commit comments

Comments
 (0)