Skip to content

Commit 9fba96b

Browse files
committed
Resolve validation issues
1 parent 30e7c43 commit 9fba96b

4 files changed

Lines changed: 71 additions & 61 deletions

File tree

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,11 @@
2222
"editor.defaultFormatter": "ms-vscode.powershell",
2323
},
2424
"cmake.ignoreCMakeListsMissing": true,
25+
"yaml.schemas": {
26+
"file:///c%3A/Users/heaths/.vscode/extensions/docsmsft.docs-yaml-1.0.5/dist/toc.schema.json": "/toc\\.yml/i",
27+
"https://raw.githubusercontent.com/microsoft/azure-pipelines-vscode/master/service-schema.json": [
28+
"file:///home/heaths/src/azure-sdk-for-rust2/eng/pipelines/templates/jobs/fetch.yml",
29+
"file:///home/heaths/src/azure-sdk-for-rust2/eng/pipelines/fetch.yml"
30+
]
31+
},
2532
}

eng/pipelines/fetch.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,18 @@ extends:
77
template: /eng/pipelines/templates/stages/1es-redirect.yml
88
parameters:
99
stages:
10-
- stage: Fetch
11-
variables:
12-
- template: /eng/pipelines/templates/variables/image.yml
13-
- template: /eng/pipelines/templates/variables/rust.yml
14-
jobs:
15-
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
16-
parameters:
17-
JobTemplatePath: /eng/pipelines/templates/jobs/fetch.yml
18-
MatrixConfigs:
19-
- Name: rust_fetch
20-
Path: /eng/pipelines/templates/stages/platform-matrix.json
21-
Selection: all
22-
GenerateVMJobs: true
23-
CloudConfig:
24-
Cloud: public
25-
SparseCheckoutPaths:
26-
- /*
10+
- stage: Fetch
11+
variables:
12+
- template: /eng/pipelines/templates/variables/image.yml
13+
- template: /eng/pipelines/templates/variables/rust.yml
14+
jobs:
15+
- template: /eng/common/pipelines/templates/jobs/generate-job-matrix.yml
16+
parameters:
17+
JobTemplatePath: /eng/pipelines/templates/jobs/fetch.yml
18+
AdditionalParameters: {}
19+
MatrixConfigs:
20+
- Name: rust_fetch
21+
Path: /eng/pipelines/templates/stages/platform-matrix.json
22+
Selection: all
23+
NonSparseParameters: RustToolchainName
24+
GenerateVMJobs: true
Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,51 @@
11
parameters:
2-
# Required parameters from generate-job-matrix.yml
3-
- name: UsePlatformContainer
4-
type: boolean
5-
- name: OSName
6-
type: string
7-
- name: Matrix
8-
type: object
9-
- name: DependsOn
10-
type: string
11-
- name: CloudConfig
12-
type: object
13-
default: {}
2+
# Required parameters from generate-job-matrix.yml
3+
- name: UsePlatformContainer
4+
type: boolean
5+
- name: OSName
6+
type: string
7+
- name: Matrix
8+
type: object
9+
- name: DependsOn
10+
type: string
11+
- name: CloudConfig
12+
type: object
13+
default: {}
1414

1515
jobs:
16-
- job:
17-
displayName: Fetch
18-
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'))
19-
dependsOn: ${{ parameters.DependsOn }}
20-
strategy:
21-
matrix: $[ ${{ parameters.Matrix }} ]
22-
variables:
23-
CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS: artifacts-cargo-credprovider
24-
pool:
25-
name: $(Pool)
26-
# 1es pipeline templates converts `image` to demands: ImageOverride under the hood
27-
# which is incompatible with image selection in the default non-1es hosted pools
28-
${{ if eq(parameters.OSName, 'macOS') }}:
29-
vmImage: $(OSVmImage)
30-
${{ else }}:
31-
image: $(OSVmImage)
32-
os: ${{ parameters.OSName }}
33-
steps:
34-
- checkout: self
35-
- ${{ if ne(RustToolchainName, 'nightly') }}:
16+
- job: Fetch
17+
condition: and(succeeded(), ne(${{ parameters.Matrix }}, '{}'))
18+
dependsOn: ${{ parameters.DependsOn }}
19+
strategy:
20+
matrix: $[ ${{ parameters.Matrix }} ]
21+
variables:
22+
CARGO_REGISTRY_GLOBAL_CREDENTIAL_PROVIDERS: artifacts-cargo-credprovider
23+
pool:
24+
name: $(Pool)
25+
# 1es pipeline templates converts `image` to demands: ImageOverride under the hood
26+
# which is incompatible with image selection in the default non-1es hosted pools
27+
${{ if eq(parameters.OSName, 'macOS') }}:
28+
vmImage: $(OSVmImage)
29+
${{ else }}:
30+
image: $(OSVmImage)
31+
os: ${{ parameters.OSName }}
32+
steps:
33+
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
34+
parameters:
35+
paths:
36+
- "/*"
3637
- template: /eng/pipelines/templates/steps/use-rust.yml@self
3738
parameters:
3839
Toolchain: nightly
39-
40-
- template: /eng/pipelines/templates/steps/use-rust.yml@self
41-
parameters:
42-
Toolchain: $(RustToolchainName)
43-
- pwsh: cargo install --locked --index sparse+https://pkgs.dev.azure.com/artifacts-public/PublicTools/_packaging/AzureArtifacts/Cargo/index/ artifacts-cargo-credprovider
44-
displayName: Install cargo credential provider
45-
- pwsh: cargo login --registry azure-sdk-for-rust
46-
displayName: Login to azure-sdk-for-rust registry
47-
- pwsh: cargo +nightly -Zscript eng/scripts/use-registry.rs azure
48-
displayName: Configure azure-sdk-for-rust registry
49-
- pwsh: cargo fetch
50-
displayName: Fetch dependencies
40+
Condition: and(succeeded(), ne(RustToolchainName, 'night'))
41+
- template: /eng/pipelines/templates/steps/use-rust.yml@self
42+
parameters:
43+
Toolchain: $(RustToolchainName)
44+
- pwsh: cargo install --locked --index sparse+https://pkgs.dev.azure.com/artifacts-public/PublicTools/_packaging/AzureArtifacts/Cargo/index/ artifacts-cargo-credprovider
45+
displayName: Install cargo credential provider
46+
- pwsh: cargo login --registry azure-sdk-for-rust
47+
displayName: Login to azure-sdk-for-rust registry
48+
- pwsh: cargo +nightly -Zscript eng/scripts/use-registry.rs azure
49+
displayName: Configure azure-sdk-for-rust registry
50+
- pwsh: cargo fetch
51+
displayName: Fetch dependencies

eng/pipelines/templates/steps/use-rust.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ parameters:
1515
- name: SetDefault
1616
type: boolean
1717
default: true
18+
- name: Condition
19+
type: string
20+
default: succeeded()
1821

1922
steps:
2023
- pwsh: |
@@ -97,4 +100,5 @@ steps:
97100
Invoke-LoggedCommand "rustup show"
98101
99102
displayName: "Use Rust ${{ parameters.Toolchain }}"
103+
condition: ${{ parameters.Condition }}
100104
workingDirectory: ${{ parameters.WorkingDirectory }}

0 commit comments

Comments
 (0)