1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-09-19 01:19:01 +00:00
starship/ci/install-cross-rust.yml
2019-09-05 00:36:27 -04:00

44 lines
1.5 KiB
YAML

# defaults for any parameters that aren't specified
parameters:
rust_version: stable
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')
# Install additional components:
- ${{ each component in parameters.components }}:
- script: rustup component add ${{ component }}
# TEMPORATY FIX UNTIL https://github.com/rust-embedded/cross/pull/169 is merged.
- script: |
git config --global user.email "not_necessery@dont.need"
git config --global user.name "I merge the things"
git clone https://github.com/rust-embedded/cross
cd cross
cargo install --force --path .
displayName: Install cross
# All platforms
- script: |
rustup -V
rustup component list --installed
rustc -Vv
cargo -V
displayName: Query rust and cargo versions