-
Notifications
You must be signed in to change notification settings - Fork 323
/
azure-pipelines.yml
200 lines (183 loc) · 5.92 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
# Branches that trigger a build on commit
trigger:
branches:
include:
- main
- rel/*
exclude:
- rel/15.*
- rel/16.*
- rel/17.0
- rel/17.1
- rel/17.2
- rel/17.3
- rel/17.4
- rel/17.5
- rel/17.6
# Branch(es) that trigger(s) build(s) on PR
pr:
branches:
include:
- main
- rel/*
paths:
exclude:
- .github/*
- .devcontainer/*
- docs/*
- .markdownlint.json
- .markdownlintignore
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- README.md
- SECURITY.md
variables:
# Cannot use key:value syntax in root defined variables
- name: _TeamName
value: TestPlatformTeam
- name: Codeql.Enabled
value: true
- name: _RunAsInternal
value: False
- name: _RunAsPublic
value: True
# Set default value for variables of PR and Public builds
- name: _SignType
value: test
- name: _SignArgs
value: ''
- name: _Sign
value: False
- name: _InternalBuildArgs
value: ' '
- name: _ReleaseVersionKind
value: ''
# Arcade is using global cache of nugets in non-windows build
# under some circumstances, but we don't respect that in our code and try to find them
# in .packages. Force the location of packages to that folder.
- name: NUGET_PACKAGES
value: '$(Build.SourcesDirectory)/.packages/'
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enablePublishTestResults: true
testResultsFormat: 'vstest'
enableTelemetry: true
enableSourceBuild: true
jobs:
- job: Windows
timeoutInMinutes: 120
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022.amd64.open
strategy:
matrix:
Release:
_BuildConfig: Release
steps:
# This steps help to understand versions of .NET runtime installed on the machine,
# which is useful to diagnose some governance issues.
- task: DotNetCoreCLI@2
displayName: 'dotnet --info'
inputs:
command: custom
custom: '--info'
- powershell: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_InternalBuildArgs)
/p:Test=false
/p:SourceBranchName=$(Build.SourceBranchName)
name: Build
displayName: Build
# -ci is allowing to import some environment variables and some required configurations
# -nobl avoid overwriting binlog of the main Build
- script: Test.cmd
-configuration $(_BuildConfig)
-ci
-nobl
-integrationTest
-performanceTest
name: Test
displayName: Test
# This step is only helpful for diagnosing some issues with vstest/test host that would not appear
# through the console or trx
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Results folders'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: TestResults
condition: failed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Shipping Packages'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping'
ArtifactName: PackageArtifacts
- task: PublishBuildArtifacts@1
displayName: 'Publish NonShippping Packages'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/NonShipping'
ArtifactName: PackageArtifacts
- task: PublishBuildArtifacts@1
displayName: 'Publish VSSetup'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
ArtifactName: VSSetupArtifacts
- job: OtherOSes
dependsOn: Windows
workspace:
clean: all
variables:
# Publish Logs seems to depend on this name of variable, so we define it
# even when we don't use matrix.
- name: _BuildConfig
value: Release
strategy:
matrix:
Ubuntu_22_04:
vmImage: ubuntu-22.04
pwsh: true
macOS_12:
vmImage: macOS-12
pwsh: true
pool:
vmImage: $[ variables['vmImage'] ]
steps:
- checkout: self
fetchDepth: 1
clean: true
# Build but don't pack, packing does not work on non-windows and we want to test what we built on Windows
# anyway. Because that is what we will publish.
- script: ./build.sh
--configuration $(_BuildConfig)
--ci
name: Build
displayName: Build
# Download the built packages into local package source, as if we built them on this machine.
- task: DownloadPipelineArtifact@2
displayName: Download Package Artifacts
inputs:
artifactName: PackageArtifacts
targetPath: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping'
- script: ./test.sh
--configuration $(_BuildConfig)
--ci
--integrationTest
--performanceTest
name: Test
displayName: Test
# This step is only helpful for diagnosing some issues with vstest/test host that would not appear
# through the console or trx
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Results folders'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: TestResults
condition: failed()