wasmer/.azure/install-rust.yml

53 lines
1.9 KiB
YAML
Raw Normal View History

2019-08-10 11:11:54 -07:00
# 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:
2019-09-01 11:15:35 -07:00
# - bash: |
# set -ex
# brew install openssl@1.1 curl
# brew link openssl@1.1 --force
# echo "##vso[task.prependpath]/usr/local/opt/openssl/bin"
# echo "##vso[task.setvariable variable=LDFLAGS;]-L/usr/local/opt/openssl/lib"
# echo "##vso[task.setvariable variable=CPPFLAGS;]-I/usr/local/opt/openssl/include"
# displayName: "Fix Cargo SSL (macOS)"
# condition: eq(variables['Agent.OS'], 'Darwin')
2019-08-10 15:32:09 -07:00
- bash: |
2019-08-10 11:11:54 -07:00
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
2019-09-01 10:45:32 -07:00
displayName: "Install Rust (Linux, macOS)"
condition: ne(variables['Agent.OS'], 'Windows_NT')
2019-08-10 11:11:54 -07:00
2019-09-01 09:42:21 -07:00
# - 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')
2019-08-10 11:11:54 -07:00
2019-08-10 14:56:58 -07:00
- bash: |
2019-08-10 11:11:54 -07:00
set -ex
2019-09-01 09:42:21 -07:00
rustup update --no-self-update $RUST_TOOLCHAIN
2019-08-10 11:11:54 -07:00
rustup default $RUST_TOOLCHAIN
rustc -Vv
cargo -V
2019-08-10 14:56:58 -07:00
displayName: Install Rust
- bash: echo "##vso[task.setvariable variable=RUSTC_VERSION;]`rustc --version`"
displayName: Set rustc version in env var