forked from dotnet/try
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
278 lines (252 loc) · 9.38 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
276
277
278
# CI and PR triggers
trigger:
- master
- feature/*
pr:
- master
- feature/*
variables:
- name: _TeamName
value: DotNetTry
- name: _BuildConfig
value: Release
- name: _PublishUsingPipelines
value: false
- name: _DotNetArtifactsCategory
value: .NETCore
- name: BlazorTemplateVersion
value: 3.0.0-preview6.19307.2
- name: DotNetSdkVersion
value: 3.0.100-preview6-012264
- name: NodeJSVersion
value: '>=12'
- name: TryDotNetPackagesPath
value: $(Build.SourcesDirectory)/artifacts/.trydotnet/packages
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: false
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableTelemetry: true
helixRepo: dotnet/try
jobs:
- job: Windows_NT
pool:
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
vmImage: windows-2019
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
name: NetCoreInternal-Int-Pool
queue: buildpool.windows.10.amd64.vs2019
variables:
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Real
- name: _BuildArgs
value: /p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/p:MicroBuild_SigningEnabled=true
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths
- checkout: self
clean: true
- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)
- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)\dotnet
- script: dotnet new -i Microsoft.AspNetCore.Blazor.Templates::$(BlazorTemplateVersion)
displayName: Install Blazor templates
- script: |
robocopy "eng\resources" "$(Build.SourcesDirectory)\artifacts"
:: robocopy return codes are terrible; 1 means files were copied
if "%errorlevel%" == "1" exit /b 0
exit /b 1
displayName: Prevent test directory crawling
- script: eng\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
-sign
-test
$(_BuildArgs)
displayName: Build / Test
env:
TRYDOTNET_PACKAGES_PATH: $(TryDotNetPackagesPath)
- task: PublishTestResults@2
displayName: Publish NPM Test Results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish packages to artifacts container
inputs:
pathToPublish: $(Build.SourcesDirectory)\artifacts\packages\$(_BuildConfig)
artifactName: packages
artifactType: container
- task: PublishBuildArtifacts@1
displayName: Publish integration tests dll
inputs:
pathToPublish: $(Build.SourcesDirectory)\artifacts\bin\NotIntegrationTests\$(_BuildConfig)
artifactName: integrationTests
artifactType: container
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enablePublishBuildAssets: false
enablePublishUsingPipelines: $(_PublishUsingPipelines)
enableTelemetry: true
helixRepo: dotnet/try
jobs:
- job: Linux
pool:
vmImage: ubuntu-16.04
variables:
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
- script: git config --global core.longpaths true
displayName: Enable `git clean` to handle long paths
- checkout: self
clean: true
- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)
- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet new -i Microsoft.AspNetCore.Blazor.Templates::$(BlazorTemplateVersion)
displayName: Install Blazor templates
- script: |
mkdir -p "$(Build.SourcesDirectory)/artifacts"
cp eng/resources/* "$(Build.SourcesDirectory)/artifacts"
displayName: Prevent test directory crawling
- script: ./eng/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
--test
displayName: Build / Test
env:
TRYDOTNET_PACKAGES_PATH: $(TryDotNetPackagesPath)
- task: PublishTestResults@2
displayName: Publish NPM Test Results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
continueOnError: true
condition: always()
# Up-to-date
- job: UpToDate_Windows
pool:
vmImage: windows-2019
steps:
- checkout: self
clean: true
- task: NodeTool@0
displayName: Add NodeJS/npm
inputs:
versionSpec: $(NodeJSVersion)
- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet new -i Microsoft.AspNetCore.Blazor.Templates::$(BlazorTemplateVersion)
displayName: Install Blazor templates
- task: PowerShell@2
displayName: Run up-to-date build check
inputs:
filePath: eng\tests\UpToDate.ps1
arguments: -configuration $(_BuildConfig) -restore -ci
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enableTelemetry: true
helixRepo: dotnet/try
jobs:
- job: IntegrationTest
dependsOn: Windows_NT
condition: succeeded()
pool:
vmImage: ubuntu-16.04
variables:
- name: PACKAGESOURCE
value: $(System.DefaultWorkingDirectory)/packages/Shipping
- name: RUN_DOTNET_TRY_INTEGRATION_TESTS
value: true
- name: TryDotNetPackagesPath
value: $(Build.SourcesDirectory)/.trydotnet/packages
steps:
- checkout: none #skip checking out the default repository resource
- task: UseDotNet@2
displayName: Add dotnet
inputs:
packageType: sdk
version: $(DotNetSdkVersion)
installationPath: $(Agent.ToolsDirectory)/dotnet
- script: dotnet new -i Microsoft.AspNetCore.Blazor.Templates::$(BlazorTemplateVersion)
displayName: Install Blazor templates
- task: DownloadBuildArtifacts@0
displayName: 'Download built packages'
inputs:
artifactName: packages
downloadPath: $(System.DefaultWorkingDirectory)
- task: DownloadBuildArtifacts@0
displayName: 'Download built integrationtests'
inputs:
artifactName: integrationTests
downloadPath: $(System.DefaultWorkingDirectory)
- script: dotnet vstest $(System.DefaultWorkingDirectory)/integrationTests/netcoreapp3.0/NotIntegrationTests.dll --ResultsDirectory:$(System.DefaultWorkingDirectory)/testResults | tee $(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\log.txt
displayName: Run integration tests
- task: PublishTestResults@2
displayName: Publish NPM Test Results
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: '$(SystemWorkingDirectory)/testResults'
continueOnError: true
condition: always()