aboutsummaryrefslogtreecommitdiff
path: root/cc/ci/azure-install-rust.yml
blob: 9c1bae888468bc8c047c91651bdc0d729cb26132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
steps:
  - bash: |
      set -e
      toolchain=$TOOLCHAIN
      if [ "$toolchain" = "" ]; then
        toolchain=stable
      fi
      if command -v rustup; then
        rustup update $toolchain
        rustup default $toolchain
      else
        curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $toolchain
        echo "##vso[task.prependpath]$HOME/.cargo/bin"
      fi
    displayName: Install rust (unix)
    condition: ne( variables['Agent.OS'], 'Windows_NT' )

  - bash: |
      set -e
      toolchain=$TOOLCHAIN
      if [ "$toolchain" = "" ]; then
        toolchain=stable-$TARGET
      fi
      if command -v rustup; then
        rustup update --no-self-update $toolchain
        rustup default $toolchain
      else
        curl.exe -sSf -o rustup-init.exe https://win.rustup.rs
        ./rustup-init.exe -y --default-toolchain $toolchain
        echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin"
      fi
    displayName: Install rust (windows)
    condition: eq( variables['Agent.OS'], 'Windows_NT' )

  - script: |
        rustc -Vv
        cargo -V
    displayName: Query rust and cargo versions