Support rustup installation for Windows
This commit is contained in:
parent
9399c7bb15
commit
d9c91b20fd
1 changed files with 9 additions and 2 deletions
11
action.yml
11
action.yml
|
@ -130,13 +130,20 @@ runs:
|
|||
run: echo "::add-matcher::${{ github.action_path }}/rust.json"
|
||||
|
||||
- name: Install rustup, if needed
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
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:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
||||
|
||||
# Resolve the correct CARGO_HOME path depending on OS
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
echo "${CARGO_HOME:-$USERPROFILE/.cargo}/bin" | sed 's|/|\\|g' >> $GITHUB_PATH
|
||||
else
|
||||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
fi
|
||||
env:
|
||||
RUNNER_OS: "${{ runner.os }}"
|
||||
|
||||
- name: rustup toolchain install ${{inputs.toolchain || 'stable'}}
|
||||
env:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue