2019-07-14 23:54:45 +02:00
|
|
|
# defaults for any parameters that aren't specified
|
|
|
|
parameters:
|
|
|
|
rust_version: stable
|
|
|
|
|
2019-05-16 17:40:30 +02:00
|
|
|
steps:
|
|
|
|
# Linux and macOS
|
|
|
|
- script: |
|
|
|
|
set -e
|
|
|
|
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
|
|
|
|
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin:/usr/local/cargo/bin"
|
|
|
|
env:
|
|
|
|
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
|
|
|
|
displayName: "Install rust (*nix)"
|
|
|
|
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
|
|
|
|
# Windows
|
|
|
|
- script: |
|
|
|
|
curl -sSf -o rustup-init.exe https://win.rustup.rs
|
|
|
|
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
|
|
|
|
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
|
|
|
|
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
|
|
|
|
env:
|
|
|
|
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
|
|
|
|
displayName: "Install rust (windows)"
|
|
|
|
condition: eq(variables['Agent.OS'], 'Windows_NT')
|
2019-07-14 23:54:45 +02:00
|
|
|
# Install additional components:
|
|
|
|
- ${{ each component in parameters.components }}:
|
|
|
|
- script: rustup component add ${{ component }}
|
|
|
|
|
|
|
|
# All platforms
|
2019-05-16 17:40:30 +02:00
|
|
|
- script: |
|
2019-07-14 23:54:45 +02:00
|
|
|
rustup -V
|
|
|
|
rustup component list --installed
|
|
|
|
rustc -Vv
|
|
|
|
cargo -V
|
2019-05-16 17:40:30 +02:00
|
|
|
displayName: Query rust and cargo versions
|