# This template installs Rust (if doesn't exist in the systems) # Also installs the desired Rust toolchain # Template inspired by Tokio and wasm-bindgen templates # Tokio template: https://github.com/tokio-rs/tokio/blob/master/ci/azure-install-rust.yml # Wasm-bindgen template: https://github.com/rustwasm/wasm-bindgen/blob/master/ci/azure-install-rust.yml steps: - bash: | set -ex if [ -x "`command -v rustup`" ]; then echo `command -v rustup` `rustup -V` installed else curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUST_TOOLCHAIN echo "##vso[task.prependpath]$HOME/.cargo/bin" fi displayName: "Install Rust (Linux)" condition: eq(variables['Agent.OS'], 'Linux') - bash: | set -ex brew install openssl brew link openssl --force brew install rustup displayName: "Install Rust (macOS)" condition: eq(variables['Agent.OS'], 'Darwin') # - bash: | # set -ex # if [ -x "`command -v rustup`" ]; then # echo `command -v rustup` `rustup -V` installed # else # choco install rust -y # # curl -sSf -o rustup-init.exe https://win.rustup.rs # # ./rustup-init.exe -y --default-toolchain $RUST_TOOLCHAIN # # echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin" # fi # displayName: "Install Rust (Windows)" # condition: eq(variables['Agent.OS'], 'Windows_NT') - bash: | set -ex rustup update --no-self-update $RUST_TOOLCHAIN rustup default $RUST_TOOLCHAIN rustc -Vv cargo -V displayName: Install Rust - bash: echo "##vso[task.setvariable variable=RUSTC_VERSION;]`rustc --version`" displayName: Set rustc version in env var