diff --git a/CHANGELOG.md b/CHANGELOG.md index 35f96bb..4962446 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +* Install rustup if not available in the CI environment. (Linux only) + The code is taken from this issue: + ## [1.0.1] - 2022-04-20 ### Added diff --git a/action.yml b/action.yml index fde6ccf..608fccf 100644 --- a/action.yml +++ b/action.yml @@ -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