Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit ca62f36

Browse files
committed
Install Rust on macOS
1 parent d134291 commit ca62f36

File tree

2 files changed

+36
-7
lines changed

2 files changed

+36
-7
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Starter pipeline
2-
# Start with a minimal pipeline that you can customize to build and deploy your code.
3-
# Add steps that build, run tests, deploy, and more:
4-
# https://aka.ms/yaml
5-
61
trigger:
72
- master
83
pr:
@@ -26,8 +21,9 @@ variables:
2621
RLS_TEST_WAIT_FOR_AGES: 1
2722

2823
steps:
29-
- script: rustup default nightly
30-
displayName: Install nightly toolchain
24+
- template: ci/azure-install-rust.yml
25+
parameters:
26+
rust_version: nightly
3127
- script: rustup component add rustfmt
3228
displayName: 'Add Rustfmt to enforce consistent formatting'
3329
- script: rustup component add rust-src rust-analysis

ci/azure-install-rust.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
steps:
2+
# Linux and macOS.
3+
- script: |
4+
set -e
5+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
6+
export PATH=$PATH:$HOME/.cargo/bin
7+
rustup toolchain install $RUSTUP_TOOLCHAIN
8+
rustup default $RUSTUP_TOOLCHAIN
9+
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
10+
env:
11+
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
12+
displayName: "Install rust (*nix)"
13+
condition: not(eq(variables['Agent.OS'], 'Windows_NT'))
14+
15+
# Windows.
16+
- script: |
17+
curl -sSf -o rustup-init.exe https://win.rustup.rs
18+
rustup-init.exe -y --default-toolchain none
19+
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
20+
rustup toolchain install %RUSTUP_TOOLCHAIN%
21+
rustup default %RUSTUP_TOOLCHAIN%
22+
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
23+
env:
24+
RUSTUP_TOOLCHAIN: ${{parameters.rust_version}}
25+
displayName: "Install rust (windows)"
26+
condition: eq(variables['Agent.OS'], 'Windows_NT')
27+
28+
# All platforms.
29+
- script: |
30+
rustup toolchain list
31+
rustc -Vv
32+
cargo -V
33+
displayName: Query rust and cargo versions

0 commit comments

Comments
 (0)