Skip to content

Commit 0675478

Browse files
authored
Add release pipeline templates (Azure#2042)
* Add rust release pipelines
1 parent 1ac0936 commit 0675478

31 files changed

+1028
-230
lines changed

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"pageables",
5252
"pkce",
5353
"pkcs",
54+
"pwsh",
5455
"posix",
5556
"reqwest",
5657
"rustup",

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2+
"azure-pipelines.1ESPipelineTemplatesSchemaFile": true,
23
"cSpell.enabled": true,
34
"editor.formatOnSave": true,
45
"rust-analyzer.cargo.features": "all",
56
"rust-analyzer.check.command": "clippy",
67
"yaml.format.printWidth": 240,
78
"[powershell]": {
89
"editor.defaultFormatter": "ms-vscode.powershell",
9-
}
10-
}
10+
},
11+
}

Cargo.lock

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ members = [
1616
"eng/test/mock_transport",
1717
"sdk/storage",
1818
"sdk/storage/azure_storage_blob",
19+
"sdk/template/azure_template_core",
20+
"sdk/template/azure_template",
1921
]
2022

2123
[workspace.package]

eng/pipelines/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ pr:
1010

1111
extends:
1212
template: /eng/pipelines/templates/stages/archetype-sdk-client.yml
13+
parameters:
14+
ServiceDirectory: auto
Lines changed: 174 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,177 @@
11
parameters:
2-
- name: ServiceDirectory
3-
type: string
4-
default: auto
5-
- name: BeforeTestSteps
6-
type: object
7-
default: []
8-
- name: AfterTestSteps
9-
type: object
10-
default: []
11-
- name: TestTimeoutInMinutes
12-
type: number
13-
default: 60
14-
- name: BuildDocs
15-
type: boolean
16-
default: true
17-
- name: TestProxy
18-
type: boolean
19-
default: false
20-
- name: TestPipeline
21-
type: boolean
22-
default: false
23-
- name: GenerateApiReviewForManualOnly
24-
type: boolean
25-
default: false
26-
- name: BuildMatrix
27-
type: object
28-
default:
29-
- pool:
30-
os: linux
31-
name: $(LINUXPOOL)
32-
image: $(LINUXVMIMAGE)
33-
Toolchains:
34-
- name: stable
35-
publish: true
36-
- name: msrv
37-
- name: nightly
38-
- pool:
39-
os: windows
40-
name: $(WINDOWSPOOL)
41-
image: $(WINDOWSVMIMAGE)
42-
Toolchains:
43-
- name: stable
44-
- name: msrv
45-
- name: nightly
46-
- pool:
47-
os: macOS
48-
name: $(MACPOOL)
49-
vmImage: $(MACVMIMAGE)
50-
Toolchains:
51-
- name: stable
52-
- name: msrv
53-
- name: nightly
54-
- name: AnalyzeToolchains
55-
type: object
56-
default: [stable]
2+
- name: ServiceDirectory
3+
type: string
4+
default: auto
5+
- name: Artifacts
6+
type: object
7+
default: []
8+
- name: PipelineArtifactName
9+
type: string
10+
default: packages
11+
- name: BeforeTestSteps
12+
type: object
13+
default: []
14+
- name: AfterTestSteps
15+
type: object
16+
default: []
17+
- name: TestTimeoutInMinutes
18+
type: number
19+
default: 60
20+
- name: BuildDocs
21+
type: boolean
22+
default: true
23+
- name: TestProxy
24+
type: boolean
25+
default: false
26+
- name: TestPipeline
27+
type: boolean
28+
default: false
29+
- name: GenerateApiReviewForManualOnly
30+
type: boolean
31+
default: false
32+
- name: BuildMatrix
33+
type: object
34+
default:
35+
- pool:
36+
os: linux
37+
name: $(LINUXPOOL)
38+
image: $(LINUXVMIMAGE)
39+
Toolchains: [stable, msrv, nightly]
40+
- pool:
41+
os: windows
42+
name: $(WINDOWSPOOL)
43+
image: $(WINDOWSVMIMAGE)
44+
Toolchains: [stable, msrv, nightly]
45+
- pool:
46+
os: macOS
47+
name: $(MACPOOL)
48+
vmImage: $(MACVMIMAGE)
49+
Toolchains: [stable, msrv, nightly]
50+
- name: AnalyzeToolchain
51+
type: string
52+
default: stable
5753

5854
jobs:
59-
- ${{ each matrix in parameters.BuildMatrix }}:
60-
- ${{ each toolchain in matrix.Toolchains }}:
61-
- job: Build_${{ matrix.pool.os }}_${{ toolchain.name }}
62-
timeoutInMinutes: 90
63-
64-
pool: ${{ matrix.pool }}
65-
66-
steps:
67-
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
68-
parameters:
69-
Paths: [/*]
70-
71-
- template: /eng/pipelines/templates/steps/test-packages.yml
72-
parameters:
73-
ServiceDirectory: ${{ parameters.ServiceDirectory }}
74-
Toolchain: ${{ toolchain.name }}
75-
ArtifactSuffix: ${{ matrix.pool.os }}_${{ toolchain.name }}
76-
PublishArtifacts: ${{ eq(toolchain.publish, 'true') }}
77-
UnitTests: true
78-
FunctionalTests: ${{ ne(variables['Build.Reason'], 'PullRequest') }}
79-
80-
- ${{ each toolchain in parameters.AnalyzeToolchains }}:
81-
- job: "Analyze_${{ toolchain }}"
82-
condition: and(succeededOrFailed(), ne(variables['Skip.Analyze'], 'true'))
83-
timeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }}
84-
85-
pool:
86-
os: linux
87-
name: $(LINUXPOOL)
88-
image: $(LINUXVMIMAGE)
89-
90-
steps:
91-
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
92-
parameters:
93-
Paths: [/*]
94-
95-
- template: /eng/pipelines/templates/steps/analyze.yml
96-
parameters:
97-
Toolchain: ${{ toolchain }}
98-
99-
- template: /eng/common/pipelines/templates/steps/check-spelling.yml
100-
parameters:
101-
ContinueOnError: false
102-
103-
# Disabled until we fix crates.io link checking
104-
# - template: /eng/common/pipelines/templates/steps/verify-links.yml
105-
# parameters:
106-
# ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
107-
# Directory: ""
108-
# Urls: (eng/common/scripts/get-markdown-files-from-changed-files.ps1)
109-
# ${{ elseif eq(parameters.ServiceDirectory, 'auto') }}:
110-
# Directory: ""
111-
# ${{ else }}:
112-
# Directory: sdk/${{ parameters.ServiceDirectory }}
113-
# CheckLinkGuidance: $true
114-
# Condition: succeededOrFailed()
55+
- job: Pack
56+
displayName: "Pack Crates"
57+
timeoutInMinutes: 90
58+
59+
pool:
60+
name: $(LINUXPOOL)
61+
image: $(LINUXVMIMAGE)
62+
os: linux
63+
64+
templateContext:
65+
sdl:
66+
sbom:
67+
enabled: true
68+
additionalComponentDetectorArgs: '--DirectoryExclusionList **/target/vendor/**'
69+
70+
steps:
71+
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
72+
parameters:
73+
paths:
74+
- "/*"
75+
76+
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], '')) }}:
77+
- script: |
78+
echo "##vso[build.addbuildtag]$(Build.Reason)"
79+
displayName: Tag build reason
80+
81+
- ${{ if eq(parameters.TestPipeline, 'true') }}:
82+
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml
83+
parameters:
84+
PackageNames: ${{ join(',', parameters.Artifacts.*.name) }}
85+
ServiceDirectory: ${{parameters.ServiceDirectory}}
86+
TestPipeline: true
87+
88+
- template: /eng/pipelines/templates/steps/pack-crates.yml
89+
parameters:
90+
ServiceDirectory: ${{ parameters.ServiceDirectory }}
91+
92+
- template: /eng/common/pipelines/templates/steps/publish-1es-artifact.yml
93+
parameters:
94+
ArtifactPath: $(Build.ArtifactStagingDirectory)
95+
ArtifactName: ${{ parameters.PipelineArtifactName }}
96+
CustomCondition: and(succeededOrFailed(), ne(variables['NoPackagesChanged'],'true'))
97+
98+
- ${{ each matrix in parameters.BuildMatrix }}:
99+
- ${{ each toolchain in matrix.Toolchains }}:
100+
- job: Test_${{ matrix.pool.os }}_${{ toolchain }}
101+
displayName: "Test: ${{ matrix.pool.os }} ${{ toolchain }}"
102+
timeoutInMinutes: 90
103+
dependsOn: Pack
104+
condition: and(succeeded(), ne(variables['SkipTests'],'true'))
105+
106+
pool: ${{ matrix.pool }}
107+
108+
steps:
109+
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
110+
parameters:
111+
paths:
112+
- "/*"
113+
114+
- download: current
115+
artifact: ${{ parameters.PipelineArtifactName }}
116+
117+
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml@self
118+
119+
- template: /eng/pipelines/templates/steps/test-packages.yml
120+
parameters:
121+
Toolchain: ${{ toolchain }}
122+
BuildArtifactName: ${{ parameters.PipelineArtifactName }}
123+
UnitTests: true
124+
FunctionalTests: ${{ ne(variables['Build.Reason'], 'PullRequest') }}
125+
126+
- job: "Analyze"
127+
condition: and(succeededOrFailed(), ne(variables['Skip.Analyze'], 'true'))
128+
timeoutInMinutes: ${{ parameters.TestTimeoutInMinutes }}
129+
130+
pool:
131+
os: linux
132+
name: $(LINUXPOOL)
133+
image: $(LINUXVMIMAGE)
134+
135+
steps:
136+
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
137+
parameters:
138+
paths:
139+
- "/*"
140+
141+
- ${{ if ne(parameters.AnalyzeToolchain, 'nightly') }}:
142+
- template: /eng/pipelines/templates/steps/use-rust.yml@self
143+
parameters:
144+
Toolchain: nightly
145+
146+
- template: /eng/pipelines/templates/steps/use-rust.yml@self
147+
parameters:
148+
Toolchain: ${{ parameters.AnalyzeToolchain }}
149+
150+
- template: /eng/common/pipelines/templates/steps/save-package-properties.yml
151+
152+
- task: Powershell@2
153+
displayName: "Run source analysis"
154+
inputs:
155+
pwsh: true
156+
filePath: $(Build.SourcesDirectory)/eng/scripts/Analyze-Code.ps1
157+
arguments: >
158+
-Toolchain '$(Toolchain)'
159+
-PackageInfoPath '$(Build.ArtifactStagingDirectory)/PackageInfo'
160+
-SkipPackageAnalysis:('$(NoPackagesChanged)' -eq 'true')
161+
162+
- template: /eng/common/pipelines/templates/steps/check-spelling.yml
163+
parameters:
164+
ContinueOnError: false
165+
166+
# Disabled until we fix crates.io link checking
167+
# - template: /eng/common/pipelines/templates/steps/verify-links.yml
168+
# parameters:
169+
# ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
170+
# Directory: ""
171+
# Urls: (eng/common/scripts/get-markdown-files-from-changed-files.ps1)
172+
# ${{ elseif eq(parameters.ServiceDirectory, 'auto') }}:
173+
# Directory: ""
174+
# ${{ else }}:
175+
# Directory: sdk/${{ parameters.ServiceDirectory }}
176+
# CheckLinkGuidance: $true
177+
# Condition: succeededOrFailed()

eng/pipelines/templates/stages/1es-redirect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extends:
5151
credscan:
5252
suppressionsFile: $(Build.SourcesDirectory)/eng/CredScanSuppression.json
5353
toolVersion: "2.3.12.23"
54-
baselineFiles: $(Build.SourcesDirectory)/eng/python.gdnbaselines
54+
baselineFiles: $(Build.SourcesDirectory)/eng/rust.gdnbaselines
5555
psscriptanalyzer:
5656
compiled: true
5757
break: true

0 commit comments

Comments
 (0)