Skip to content

Commit

Permalink
Import rustup.yml and deal with preexisting rustup
Browse files Browse the repository at this point in the history
  • Loading branch information
ctz committed Jun 17, 2019
1 parent 425d609 commit 6a47cd5
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .azure-pipelines.yml
Expand Up @@ -17,14 +17,14 @@ jobs:
pool:
vmImage: vs2017-win2016
steps:
- template: az-pipeline/unstable/rustup.yml@templates
- template: admin/pipelines/rustup.yml
- template: admin/pipelines/cargo-steps.yml
- template: admin/pipelines/bench.yml
- job: MacOS
pool:
vmImage: macOS-10.13
steps:
- template: az-pipeline/unstable/rustup.yml@templates
- template: admin/pipelines/rustup.yml
- template: admin/pipelines/cargo-steps.yml
- template: admin/pipelines/bench.yml
- job: Linux
Expand All @@ -41,7 +41,7 @@ jobs:
minimum:
rustup_toolchain: ${{ variables.minimum_toolchain }}
steps:
- template: az-pipeline/unstable/rustup.yml@templates
- template: admin/pipelines/rustup.yml
parameters:
rustup_toolchain: $(rustup_toolchain)
- template: admin/pipelines/cargo-steps.yml
Expand All @@ -54,7 +54,7 @@ jobs:
pool:
vmImage: ubuntu-16.04
steps:
- template: az-pipeline/unstable/rustup.yml@templates
- template: admin/pipelines/rustup.yml
parameters:
rustup_toolchain: nightly
- template: admin/pipelines/coverage.yml
Expand All @@ -65,7 +65,7 @@ jobs:
pool:
vmImage: ubuntu-16.04
steps:
- template: az-pipeline/unstable/rustup.yml@templates
- template: admin/pipelines/rustup.yml
parameters:
rustup_toolchain: nightly
- template: admin/pipelines/min-versions.yml
36 changes: 36 additions & 0 deletions admin/pipelines/rustup.yml
@@ -0,0 +1,36 @@
parameters:
rustup_toolchain: 'stable'
rustup_target: ''
components: []

steps:
# Linux and macOS.
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
export PATH=$PATH:$HOME/.cargo/bin
rustup default ${{ parameters.rustup_toolchain }}
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
condition: ne( variables['Agent.OS'], 'Windows_NT' )
displayName: Install rust
# Windows.
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain none
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
rustup default ${{ parameters.rustup_toolchain }}
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Install rust (windows)
# All platforms.
- script: |
rustc -Vv
cargo -V
displayName: Query rust and cargo versions
- ${{ if ne(parameters.rustup_target, '') }}:
- script: |
rustup target add ${{ parameters.rustup_target }}
displayName: Install support for ${{ parameters.rustup_target }}
- ${{ each component in parameters.components }}:
- script: |
rustup component add ${{ component }}
displayName: Install ${{ component }}

0 comments on commit 6a47cd5

Please sign in to comment.