forked from dotnet/xharness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
234 lines (208 loc) · 7.85 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
variables:
- template: eng/common-variables.yml
- name: Build.Repository.Clean
value: true
- template: /eng/common/templates/variables/pool-providers.yml
# CI and PR triggers
trigger:
batch: true
branches:
include:
- main
- xcode/*
pr:
branches:
include:
- main
- xcode/*
# Build
stages:
- stage: Build_Windows_NT
displayName: Build Windows
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableTelemetry: true
enablePublishBuildArtifacts: true
enableMicrobuild: true
enablePublishUsingPipelines: true
enablePublishBuildAssets: true
helixRepo: dotnet/xharness
jobs:
- job: Windows_NT
pool:
${{ if eq(variables._RunAsInternal, True) }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2019.amd64
${{ if eq(variables._RunAsPublic, True) }}:
vmImage: windows-2019
strategy:
matrix:
Release:
_BuildConfig: Release
${{ if eq(variables._RunAsPublic, True) }}:
Debug:
_BuildConfig: Debug
steps:
- ${{ if eq(variables._RunAsPublic, False) }}:
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_InternalBuildArgs)
/p:Test=false
name: Build
displayName: Build
condition: succeeded()
- ${{ if eq(variables._RunAsPublic, True) }}:
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_InternalBuildArgs)
name: Build
displayName: Build and run tests
condition: succeeded()
- task: PublishTestResults@2
displayName: 'Publish Unit Test Results'
inputs:
testResultsFormat: xUnit
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/**/*.xml'
mergeTestResults: true
searchFolder: $(system.defaultworkingdirectory)
testRunTitle: XHarness unit tests - $(Agent.JobName)
condition: succeededOrFailed()
- ${{ if eq(variables._RunAsPublic, False) }}:
- task: ComponentGovernanceComponentDetection@0
displayName: Component Governance scan
inputs:
ignoreDirectories: '$(Build.SourcesDirectory)/.packages,$(Build.SourcesDirectory)/artifacts/obj/Microsoft.DotNet.XHarness.CLI/android-tools-unzipped'
- ${{ if eq(variables._RunAsPublic, True) }}:
- stage: Build_OSX
displayName: Build OSX
dependsOn:
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableTelemetry: true
enablePublishBuildArtifacts: true
enableMicrobuild: true
enablePublishUsingPipelines: true
enablePublishBuildAssets: true
helixRepo: dotnet/xharness
jobs:
- job: OSX
pool:
vmImage: macOS-11
strategy:
matrix:
Release:
_BuildConfig: Release
${{ if eq(variables._RunAsPublic, True) }}:
Debug:
_BuildConfig: Debug
steps:
- ${{ if eq(variables._RunAsPublic, False) }}:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
$(_InternalBuildArgs)
/p:Test=false
name: Build
displayName: Build
condition: succeeded()
- ${{ if eq(variables._RunAsPublic, True) }}:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
$(_InternalBuildArgs)
name: Build
displayName: Build and run tests
condition: succeeded()
- publish: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping/Microsoft.DotNet.XHarness.CLI.1.0.0-ci.nupkg
artifact: Microsoft.DotNet.XHarness.CLI.$(_BuildConfig)
displayName: Publish XHarness CLI for Helix Testing
condition: and(succeeded(), eq(variables['_BuildConfig'], 'Debug'))
- task: PublishTestResults@2
displayName: 'Publish Unit Test Results'
inputs:
testResultsFormat: xUnit
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/**/*.xml'
mergeTestResults: true
searchFolder: $(system.defaultworkingdirectory)
testRunTitle: XHarness unit tests - $(Agent.JobName)
condition: succeededOrFailed()
# E2E tests
- template: eng/e2e-test.yml
parameters:
name: E2E_Android_Simulators
displayName: Android - Simulators
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Android/Simulator.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_Android_Devices
displayName: Android - Devices
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Android/Device.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_Android_Manual_Commands
displayName: Android - Manual Commands
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Android/Commands.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_Apple_Simulators
displayName: Apple - Simulators
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Apple/Simulator.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_iOS_Devices
displayName: Apple - iOS devices
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Apple/Device.iOS.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_tvOS_Devices
displayName: Apple - tvOS devices
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Apple/Device.tvOS.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_Apple_Simulator_Commands
displayName: Apple - Simulator Commands
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Apple/Simulator.Commands.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_Apple_Device_Commands
displayName: Apple - Device Commands
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Apple/Device.Commands.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_Apple_Simulator_Mgmt
displayName: Apple - Simulator management
testProject: $(Build.SourcesDirectory)/tests/integration-tests/Apple/SimulatorInstaller.Tests.proj
- template: eng/e2e-test.yml
parameters:
name: E2E_WASM
displayName: WASM
testProject: $(Build.SourcesDirectory)/tests/integration-tests/WASM/WASM.Helix.SDK.Tests.proj
# NuGet publishing
- ${{ if eq(variables._RunAsInternal, True) }}:
- template: eng\common\templates\post-build\post-build.yml
parameters:
publishingInfraVersion: 3
enableSymbolValidation: true
enableSourceLinkValidation: true
validateDependsOn:
- Build_Windows_NT
publishDependsOn:
- Validate
# This is to enable SDL runs part of Post-Build Validation Stage
SDLValidationParameters:
enable: false
continueOnError: false
params: ' -SourceToolsList @("policheck","credscan")
-TsaInstanceURL $(_TsaInstanceURL)
-TsaProjectName $(_TsaProjectName)
-TsaNotificationEmail $(_TsaNotificationEmail)
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
-TsaBugAreaPath $(_TsaBugAreaPath)
-TsaIterationPath $(_TsaIterationPath)
-TsaRepositoryName "dotnet-xharness"
-TsaCodebaseName "dotnet-xharness"
-TsaPublish $True'