From 8ba04cb6f202a6d5ed9067e385679ec9fa4a607f Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Tue, 19 Jul 2022 18:48:19 +0000 Subject: [PATCH] Install rustup if not available, Linux only The original code stems from this PR: https://github.com/dtolnay/rust-toolchain/pull/8 --- CHANGELOG.md | 5 +++++ action.yml | 8 ++++++++ 2 files changed, 13 insertions(+) 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