forked from microsoft/vstest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
225 lines (197 loc) · 7.07 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
trigger:
- main
- rel/*
pr:
- main
- rel/*
jobs:
- job: Windows
timeoutInMinutes: 120
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- checkout: self
fetchDepth: 1
clean: true
- task: BatchScript@1
displayName: 'Run script build.cmd'
inputs:
filename: build.cmd
arguments: '-verbose -configuration $(buildConfiguration) -ci -steps "InstallDotnet, Restore, UpdateLocalization, Build, Publish, Pack, Manifest"'
modifyEnvironment: false
failOnStandardError: true
- task: PowerShell@2
displayName: 'Disable Strong Name Validation'
inputs:
targetType: 'inline'
script: |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework" -Name "AllowStrongNameBypass" -Value 1 -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework" -Name "AllowStrongNameBypass" -Value 1 -Force
reg DELETE "HKLM\Software\Microsoft\StrongName\Verification" /f
reg DELETE "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification" /f
reg ADD "HKLM\Software\Microsoft\StrongName\Verification\*,*" /f
reg ADD "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification\*,*" /f
- task: BatchScript@1
displayName: 'Run Unit Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration)'
modifyEnvironment: false
failOnStandardError: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **\*.trx'
inputs:
testResultsFormat: VSTest
testResultsFiles: '**\*.trx'
condition: succeededOrFailed()
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.SourcesDirectory)\artifacts'
artifact: 'testArtifacts'
publishLocation: 'pipeline'
- job: WindowsAcceptance
dependsOn: Windows
timeoutInMinutes: 120
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- checkout: self
fetchDepth: 1
clean: true
- task: PowerShell@2
displayName: 'Free space'
inputs:
targetType: 'inline'
script: 'Get-PSDrive -PSProvider FileSystem | Out-String'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'testArtifacts'
targetPath: '$(Build.SourcesDirectory)\artifacts'
- task: PowerShell@2
displayName: 'Free space'
inputs:
targetType: 'inline'
script: 'Get-PSDrive -PSProvider FileSystem | Out-String'
- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'ls "$(Build.SourcesDirectory)\artifacts\" -Recurse -Dir'
- task: BatchScript@1
displayName: 'Run script build.cmd'
inputs:
filename: build.cmd
# build should not be needed in the end, we are copying the build task from the build folder, but we should get
# it either from artifacts, if present, or from extracted package file
# Adding it at the moment to avoid this error: #[error]Copy-Item : Cannot find path 'D:\a\1\s\src\Microsoft.TestPlatform.Build\bin\Release\netstandard2.0' because it does not exist.
arguments: '-verbose -configuration $(buildConfiguration) -ci -steps "InstallDotnet, Restore, Build, PrepareAcceptanceTests"'
modifyEnvironment: false
failOnStandardError: true
- task: PowerShell@2
inputs:
targetType: 'inline'
script: 'ls "$(Build.SourcesDirectory)\artifacts\Release\packages"'
- task: PowerShell@2
displayName: 'Free space'
inputs:
targetType: 'inline'
script: 'Get-PSDrive -PSProvider FileSystem | Out-String'
- task: PowerShell@2
displayName: 'Disable Strong Name Validation'
inputs:
targetType: 'inline'
script: |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework" -Name "AllowStrongNameBypass" -Value 1 -Force
Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework" -Name "AllowStrongNameBypass" -Value 1 -Force
reg DELETE "HKLM\Software\Microsoft\StrongName\Verification" /f
reg DELETE "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification" /f
reg ADD "HKLM\Software\Microsoft\StrongName\Verification\*,*" /f
reg ADD "HKLM\Software\Wow6432Node\Microsoft\StrongName\Verification\*,*" /f
- task: BatchScript@1
displayName: 'Run Acceptance Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p AcceptanceTests -f net48'
modifyEnvironment: false
failOnStandardError: true
- task: BatchScript@1
displayName: 'Run Platform Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p platformtests'
modifyEnvironment: false
failOnStandardError: true
- task: BatchScript@1
displayName: 'Run Smoke Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p smoke'
modifyEnvironment: false
failOnStandardError: true
- task: BatchScript@1
displayName: 'Run Performance Tests'
inputs:
filename: test.cmd
arguments: '-verbose -configuration $(buildConfiguration) -p Performance -f net48'
modifyEnvironment: false
failOnStandardError: true
- task: PublishTestResults@2
displayName: 'Publish Test Results **\*.trx'
inputs:
testResultsFormat: VSTest
testResultsFiles: '**\*.trx'
condition: succeededOrFailed()
- job: OtherOSes
dependsOn: Windows
workspace:
clean: all
strategy:
matrix:
Ubuntu_22_04:
vmImage: ubuntu-22.04
pwsh: true
macOS_11:
vmImage: macOS-11
pwsh: true
pool:
vmImage: $[ variables['vmImage'] ]
variables:
buildConfiguration: 'Release'
VSTestRTMBuild: 'false'
steps:
- checkout: self
fetchDepth: 1
clean: true
- script: chmod +x ./scripts/vsts-prebuild.sh
displayName: 'Preparing for set version'
- script: ./scripts/vsts-prebuild.sh -build "preview-$(Build.BuildNumber)" -rtm "$(VSTestRTMBuild)" -branch "$(Build.SourceBranch)"
displayName: 'Set Version'
- script: ./build.sh -c $(buildConfiguration) -v "$(BuildVersionPrefix)" -vs "$(BuildVersionSuffix)" -ci true -verbose
displayName: 'Build'
- script: ./test.sh -c $(buildConfiguration) -p Unit
displayName: 'Unit tests'
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'testArtifacts'
targetPath: '$(Build.SourcesDirectory)/artifacts'
- script: ./tools/dotnet-linux/dotnet build -c $(buildConfiguration) ./test/TestAssets/TestAssets.sln
displayName: 'Build test assets'
- script: ./test.sh -c $(buildConfiguration) -p Acceptance
displayName: 'Acceptance tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results **/*.trx'
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/*.trx'
condition: succeededOrFailed()
- template: /eng/common/templates/job/source-build.yml
parameters:
platform:
name: Managed
container: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7
buildScript: eng/common/build.sh