forked from dotnet/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
275 lines (267 loc) · 9.87 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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#
# See https://docs.microsoft.com/azure/devops/pipelines/yaml-schema for details
#
variables:
- name: _TeamName
value: AspNetCore
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: _PublishUsingPipelines
value: true
- name: _DotNetArtifactsCategory
value: ASPNETEXTENSIONS
# CI and PR triggers
trigger:
batch: true
branches:
include:
- master
- release/*
pr:
autoCancel: false
branches:
include:
- '*'
jobs:
- job: Code_check
displayName: Code check
workspace:
clean: all
pool:
vmImage: vs2017-win2016
steps:
- powershell: . ./activate.ps1; ./restore.cmd -ci; ./eng/scripts/CodeCheck.ps1 -ci
displayName: Run eng/scripts/CodeCheck.ps1
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableTelemetry: true
helixRepo: aspnet/Extensions
jobs:
- job: Windows
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2017.Open
${{ if ne(variables['System.TeamProject'], 'public') }}:
name: NetCoreInternal-Pool
queue: BuildPool.Windows.10.Amd64.VS2017
variables:
# Only enable publishing in official builds.
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
# DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- group: DotNet-Blob-Feed
- group: Publish-Build-Assets
- name: _OfficialBuildArgs
value: /p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _OfficialBuildArgs
value: ''
strategy:
matrix:
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
Debug:
_BuildConfig: Debug
_SignType: test
_DotNetPublishToBlobFeed: false
_BuildArgs:
Release:
_BuildConfig: Release
# PRs or external builds are not signed.
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: test
_DotNetPublishToBlobFeed: false
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
_SignType: real
_DotNetPublishToBlobFeed: true
_BuildArgs: $(_OfficialBuildArgs)
steps:
- checkout: self
clean: true
- task: NuGetCommand@2
displayName: 'Clear NuGet caches'
condition: succeeded()
inputs:
command: custom
arguments: 'locals all -clear'
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_BuildArgs)
displayName: Build and Publish
- script: eng\scripts\ci-flaky-tests.cmd -configuration $(_BuildConfig)
displayName: Run Flaky Tests
continueOnError: true
- powershell: eng\common\msbuild.ps1 eng/repo.targets /t:TagCiBuilds '/p:IsFinalBuild=$(IsFinalBuild)' '/p:CI=true'
displayName: Set CI Tags
condition: eq(variables['_BuildConfig'], 'Release')
- powershell: eng\scripts\KillProcesses.ps1
displayName: Kill processes
condition: always()
- task: PublishTestResults@2
displayName: Publish Flaky Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Upload package artifacts
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
inputs:
pathtoPublish: artifacts/packages/
artifactName: artifacts
artifactType: Container
parallel: true
- job: Ubuntu_16_04
displayName: 'Ubuntu 16.04'
pool:
vmImage: ubuntu-16.04
variables:
# Only enable publishing in official builds.
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _OfficialBuildArgs
value: -p:OfficialBuildId=$(Build.BuildNumber)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _OfficialBuildArgs
value: ''
strategy:
matrix:
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
Debug:
_BuildConfig: Debug
_SignType: none
_DotNetPublishToBlobFeed : false
Release:
_BuildConfig: Release
_SignType: none
_DotNetPublishToBlobFeed : false
steps:
- checkout: self
clean: true
- task: NodeTool@0
displayName: Install Node 10.x
inputs:
versionSpec: 10.x
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
-p:BuildNodeJS=true
$(_OfficialBuildArgs)
displayName: Build
- script: eng/scripts/ci-flaky-tests.sh --configuration $(_BuildConfig)
displayName: Run Flaky Tests
continueOnError: true
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
condition: always()
- task: PublishTestResults@2
displayName: Publish Flaky Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Upload NPM artifacts
condition: and(succeeded(), eq(variables['_BuildConfig'], 'Release'))
inputs:
pathtoPublish: artifacts/npm/
artifactName: NpmArtifacts
artifactType: Container
parallel: true
- job: OSX_10_13
displayName: 'OSX'
pool:
vmImage: macOS-10.13
strategy:
matrix:
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
Debug:
_BuildConfig: Debug
_SignType: none
_DotNetPublishToBlobFeed : false
Release:
_BuildConfig: Release
_SignType: none
_DotNetPublishToBlobFeed : false
steps:
- checkout: self
clean: true
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
displayName: Build
- script: eng/scripts/ci-flaky-tests.sh --configuration $(_BuildConfig)
displayName: Run Flaky Tests
continueOnError: true
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
condition: always()
- task: PublishTestResults@2
displayName: Publish Flaky Test Results
inputs:
testResultsFormat: 'xUnit'
testResultsFiles: '*.xml'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/Flaky'
continueOnError: true
condition: always()
- job: Source_Build
displayName: 'Test: Linux Source Build'
container: centos:7
pool:
vmImage: 'ubuntu-16.04'
variables:
DotNetCoreSdkDir: $(Agent.ToolsDirectory)/dotnet
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: true
steps:
- script: |
source eng/common/native/common-library.sh
mkdir -p $HOME/bin
GetFile https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 $HOME/bin/jq
chmod +x $HOME/bin/jq
echo "##vso[task.prependpath]$HOME/bin"
displayName: Install jq
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
# The SDK version selected here is intentionally supposed to use the latest release
# For the purpose of building Linux distros, we can't depend on features of the SDK
# which may not exist in pre-built versions of the SDK
version: 3.0.x
installationPath: $(DotNetCoreSdkDir)
includePreviewVersions: true
- script: ./eng/scripts/ci-source-build.sh --ci --configuration Release
displayName: Run ci-source-build.sh
- task: PublishBuildArtifacts@1
displayName: Upload logs
continueOnError: true
inputs:
pathtoPublish: artifacts/log/
artifactName: Source_Build_Logs
artifactType: Container
parallel: true
- task: PublishBuildArtifacts@1
displayName: Upload package artifacts
# Only capture source build artifacts in PRs for the sake of inspecting
# changes that impact source-build. The artifacts from this build pipeline are never actually used.
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
inputs:
pathtoPublish: artifacts/packages/
artifactName: Source_Build_Packages
artifactType: Container
parallel: true