-
Notifications
You must be signed in to change notification settings - Fork 676
/
azure-pipelines.yml
228 lines (199 loc) · 8.15 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# This pipeline is used to build the PTVS product and installer.
# A seperate release pipeline is used to create insertion PR's into Visual Studio.
# The pipeline extends v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates from 1esPipelines repository defined in resources section.
parameters:
- name: pylanceVersion
displayName: Pylance Version
type: string
default: latest
- name: pylanceReleaseType
displayName: Pylance Release Type
type: string
default: stable
values:
- stable
- preview
- name: debugpyVersion
displayName: Debugpy Version
type: string
default: latest
- name: skipGlassCache
displayName: Skip Glass Cache
type: boolean
default: false
# build number format
name: $(date:yy)$(DayOfYear)$(rev:.r)
# Trigger ci builds for commits into master and any release branches
# Ignore changes to other yml files, since they are for different pipelines
trigger:
branches:
include:
- main
- release/*
paths:
exclude:
- 'azure-pipelines-*.yml'
# Trigger pr builds for commits into master and any release branches
# Ignore changes to other yml files, since they are for different pipelines
# Also ignore draft PR's
pr:
branches:
include:
- main
- release/*
paths:
exclude:
- 'azure-pipelines-*.yml'
drafts: false
# Trigger builds on a nightly schedule
# Always run, even if there are no PTVS changes, because we want the latest changes from all dependencies
# such as pylance, debugpy, and the latest VS int-preview bits pulled into our bootstrapper.
schedules:
- cron: "0 8 * * *"
displayName: Nightly build
branches:
include:
- main
always: true
# Build variables
# None of these are settable at build queue time. To do that, remove the variable from this list,
# browse to the pipeline editor in AzDO, add the variable there, and make it settable at queue time.
variables:
- name: DropRoot
value: \\cpvsbuild\Drops\DSTools\PTVS\$(Build.SourceBranchName)\$(Build.BuildNumber)\
- name: FileVersionPrefix
value: 17.0
- name: IncludeDjangoHtmlExtensions
value: true
- name: IncludeMiniconda
value: true
- name: IncludeMSI
value: false
- name: IncludeUWP
value: false
- name: TrackFileAccess
value: false
- name: Packaging.EnableSBOMSigning
value: false # disabled for now because of known issue
- name: SkipGlassCache
value: ${{ parameters.skipGlassCache }}
# If the build ran because of a nightly schedule, force pylance release type to preview
- name: pylanceReleaseTypeVar
${{ if eq(variables['Build.Reason'], 'Schedule') }}:
value: preview
${{ else }}:
value: ${{ parameters.pylanceReleaseType }}
# Import variables from PTVS-Dev17 variable group
- group: PTVS-Dev17
# The `resources` specify the location and version of the 1ES PT.
# The ref of the repository is set to release tag which is intended to be used by most pipelines.
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
# The pool includes the name of your 1ES hosted pool and a VM image in that pool. Also, use os to
# specify the image type. Here are the allowed values: windows, linux, or macOS. The default value is windows.
# Hence, this property must be specified for linux and macOS.
pool:
name: VSEngSS-MicroBuild2022-1ES
os: windows
settings:
skipBuildTagsForGitHubPullRequests: true
stages:
- stage: build
displayName: Build
jobs:
- job: build
displayName: Build
# If the pipeline publishes artifacts, use `templateContext` to define the artifacts.
# This will enable 1ES PT to run SDL analysis tools on the artifacts and then upload them.
templateContext:
# Disable code signing validation because we don't ship ANY of the artifacts that we publish.
# The only released artifacts are uploaded via the 1ES.MicroBuildVstsDrop@1 below.
sdl:
codeSignValidation:
enabled: false
outputs:
- output: pipelineArtifact
displayName: 'Publish build artifact: binaries'
targetPath: '$(Build.BinariesDirectory)/raw/binaries'
artifactName: Binaries
- output: pipelineArtifact
displayName: 'Publish build artifact: raw'
condition: failed()
targetPath: '$(Build.BinariesDirectory)\raw'
artifactName: raw
- output: pipelineArtifact
displayName: 'Publish build artifact: logs'
condition: succeededOrFailed()
targetPath: '$(Build.SourcesDirectory)\logs'
artifactName: Logs
- output: pipelineArtifact
displayName: 'Publish build artifact: TestData'
targetPath: '$(Build.ArtifactStagingDirectory)/TestDataFolder/TestData.zip'
sbomBuildDropPath: '$(Build.ArtifactStagingDirectory)/TestDataFolder'
artifactName: 'TestData'
- output: pipelineArtifact
displayName: 'Publish build artifact: RunSettings'
targetPath: '$(Build.SourcesDirectory)/Python/Tests/TestData/default.runsettings'
sbomBuildDropPath: '$(Build.SourcesDirectory)/Python/Tests/TestData'
artifactName: 'RunSettings'
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- output: pipelineArtifact
displayName: 'Publish build artifact: BoM'
targetPath: '$(Build.BinariesDirectory)\layout'
artifactName: SBOM
steps:
# check out code clean from source control
- checkout: self
clean: true
# Non-PR steps
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
# add VSTarget build tag
- powershell: 'Write-Host "##vso[build.addbuildtag]$env:VSTarget"'
displayName: 'Add vstarget build tag'
# install microbuild plugins used for swixproj/vsmanproj, signing, and localization
- template: /Build/templates/install_microbuild_plugins.yml@self
# Restore packages and install dependencies (pylance, debugpy)
- template: /Build/templates/restore_packages.yml@self
parameters:
pylanceVersion: ${{ parameters.pylanceVersion }}
pylanceReleaseType: ${{ variables.pylanceReleaseTypeVar }}
debugpyVersion: ${{ parameters.debugpyVersion }}
# Build and publish logs
- template: /Build/templates/build.yml@self
# Non-PR steps
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
# Create VS bootstrapper for testing
- template: Build/templates/create_vs_bootstrapper.yml@self
# Upload vsts drop used by Visual Studio insertions
# For more info, see https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-pipeline-templates/features/outputs/microbuild-vsts-drop
- task: 1ES.MicroBuildVstsDrop@1
displayName: 'Upload vsts drop'
inputs:
dropFolder: '$(Build.StagingDirectory)\release'
dropServiceUri: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection'
vsDropServiceUri: 'https://vsdrop.corp.microsoft.com/file/v1'
accessToken: '$(System.AccessToken)'
dropRetentionDays: 183
# publish symbols
- template: /Build/templates/publish_symbols.yml@self
# MicroBuild cleanup
- task: MicroBuildCleanup@1
displayName: 'Execute cleanup tasks'
condition: succeededOrFailed()
# Publish test data
- template: /Build/templates/publish_test_data.yml@self
# Run tests on mixed mode debugger but only for PR builds
- ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), eq(variables['SkipGlassCache'], true)) }}:
- job: test
displayName: Test
steps:
- template: /Build/templates/run_tests.yml@self
parameters:
skipGlassCache: ${{ parameters.skipGlassCache }}