Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/build/azure-pipelines/cli/install-rust-posix.yml
3520 views
1
parameters:
2
- name: channel
3
type: string
4
default: 1.85
5
- name: targets
6
default: []
7
type: object
8
9
# Todo: use 1ES pipeline once extension is installed in ADO
10
11
steps:
12
- task: RustInstaller@1
13
inputs:
14
rustVersion: ms-${{ parameters.channel }}
15
cratesIoFeedOverride: $(CARGO_REGISTRY)
16
additionalTargets: ${{ join(' ', parameters.targets) }}
17
toolchainFeed: https://pkgs.dev.azure.com/monacotools/Monaco/_packaging/vscode/nuget/v3/index.json
18
default: true
19
addToPath: true
20
displayName: Install MSFT Rust
21
condition: and(succeeded(), ne(variables['CARGO_REGISTRY'], 'none'))
22
23
- script: |
24
set -e
25
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal --default-toolchain $RUSTUP_TOOLCHAIN
26
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
27
env:
28
RUSTUP_TOOLCHAIN: ${{ parameters.channel }}
29
displayName: Install OSS Rust
30
condition: and(succeeded(), eq(variables['CARGO_REGISTRY'], 'none'))
31
32
- script: |
33
set -e
34
rustup default $RUSTUP_TOOLCHAIN
35
rustup update $RUSTUP_TOOLCHAIN
36
rustup component add clippy
37
env:
38
RUSTUP_TOOLCHAIN: ${{ parameters.channel }}
39
displayName: "Set Rust version"
40
condition: and(succeeded(), eq(variables['CARGO_REGISTRY'], 'none'))
41
42
- ${{ each target in parameters.targets }}:
43
- script: rustup target add ${{ target }}
44
displayName: "Adding Rust target '${{ target }}'"
45
condition: and(succeeded(), eq(variables['CARGO_REGISTRY'], 'none'))
46
47
- script: |
48
set -e
49
rustc --version
50
cargo --version
51
displayName: "Check Rust versions"
52
53