Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import rustup.yml and deal with preexisting rustup
- Loading branch information
Showing
2 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
parameters: | ||
rustup_toolchain: 'stable' | ||
rustup_target: '' | ||
components: [] | ||
|
||
steps: | ||
# Linux and macOS. | ||
- script: | | ||
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none | ||
export PATH=$PATH:$HOME/.cargo/bin | ||
rustup default ${{ parameters.rustup_toolchain }} | ||
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" | ||
condition: ne( variables['Agent.OS'], 'Windows_NT' ) | ||
displayName: Install rust | ||
# Windows. | ||
- script: | | ||
curl -sSf -o rustup-init.exe https://win.rustup.rs | ||
rustup-init.exe -y --default-toolchain none | ||
set PATH=%PATH%;%USERPROFILE%\.cargo\bin | ||
rustup default ${{ parameters.rustup_toolchain }} | ||
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" | ||
condition: eq( variables['Agent.OS'], 'Windows_NT' ) | ||
displayName: Install rust (windows) | ||
# All platforms. | ||
- script: | | ||
rustc -Vv | ||
cargo -V | ||
displayName: Query rust and cargo versions | ||
- ${{ if ne(parameters.rustup_target, '') }}: | ||
- script: | | ||
rustup target add ${{ parameters.rustup_target }} | ||
displayName: Install support for ${{ parameters.rustup_target }} | ||
- ${{ each component in parameters.components }}: | ||
- script: | | ||
rustup component add ${{ component }} | ||
displayName: Install ${{ component }} |