parameters: toolchain: stable components: [] targets: [] steps: - 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" env: RUSTUP_TOOLCHAIN: ${{parameters.toolchain}} displayName: "Install Rust (Linux and MacOS)" condition: not(eq(variables['Agent.OS'], 'Windows_NT')) - 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.toolchain}} displayName: "Install Rust (Windows)" condition: eq(variables['Agent.OS'], 'Windows_NT') - bash: | rustup default $TOOLCHAIN rustup update $TOOLCHAIN env: TOOLCHAIN: ${{ parameters.toolchain }} displayName: "Set correct Rust version" - script: | echo "Rustup Version" rustup -V echo "Rustup Installed Components" rustup component list --installed echo "Rustc Version" rustc -Vv echo "Cargo version" cargo -V displayName: "Ensure integrity of Rust toolchain"