-
Notifications
You must be signed in to change notification settings - Fork 6
/
azure-pipelines-windows.yml
258 lines (225 loc) · 13.3 KB
/
azure-pipelines-windows.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
trigger:
branches:
include:
- main
- dev
paths:
exclude:
- .gitignore.txt
- README.md
- LICENSE
- azure-pipelines-linux.yml
- azure-pipelines-macos.yml
pr:
- dev
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
disable.coverage.autogenerate: 'true'
steps:
- task: UseDotNet@2
displayName: 'Install .NET Core 3.1 SDK'
inputs:
packageType: sdk
version: 3.1.x
- task: UseDotNet@2
displayName: 'Install .NET Core 6.0 SDK'
inputs:
packageType: sdk
version: 6.0.x
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: 'AudioWorks\AudioWorks.sln'
displayName: 'Restore dependencies'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: 'AudioWorks\AudioWorks.sln'
arguments: '--configuration $(buildConfiguration)'
displayName: 'Build $(buildConfiguration) configuration'
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '**\Extensions\**\*.csproj'
packDirectory: '$(Build.ArtifactStagingDirectory)\prereleases\extensions'
configurationToPack: $(buildConfiguration)
nobuild: 'true'
buildProperties: 'VersionSuffix="pre.$(Build.BuildId)"'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/dev'))
displayName: 'Package extensions'
- powershell: |
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://audioworks.blob.core.windows.net/prerequisites/AppleApplicationSupport.msi -OutFile AppleApplicationSupport.msi
Invoke-WebRequest -Uri https://audioworks.blob.core.windows.net/prerequisites/AppleApplicationSupport64.msi -OutFile AppleApplicationSupport64.msi
displayName: 'Download prerequisites'
- script: |
COPY /Y nuget.exe %USERPROFILE%
msiexec /i AppleApplicationSupport.msi /qb-
msiexec /i AppleApplicationSupport64.msi /qb-
displayName: 'Install prerequisites'
- powershell: Write-Host echo "##vso[task.setvariable variable=localAppDataDir]$([System.Environment]::GetFolderPath(28))\AudioWorks"
displayName: Set local application data directory
- powershell: |
$localFeedDir = "$env:LOCALAPPDATADIR\LocalFeed"
$roamingAppDir = "$([System.Environment]::GetFolderPath(26))\AudioWorks"
New-Item $roamingAppDir -ItemType Directory
$content = Get-Content AudioWorks\src\AudioWorks.Common\settings.json | ConvertFrom-Json
$content.ExtensionRepository = $localFeedDir
$content.AutomaticExtensionDownloads = $false
$content.UsePreReleaseExtensions = $true
$content | ConvertTo-Json | Set-Content "$roamingAppDir\settings.json"
dotnet test AudioWorks\tests\AudioWorks.Api.Tests --configuration $env:BUILDCONFIGURATION --filter "FullyQualifiedName~AudioWorks.Api.Tests.ExtensionInstallerTests" --no-build --results-directory $env:AGENT_TEMPDIRECTORY --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*%2c[AudioWorks.TestUtilities]*
Write-Host
Write-Host 'Installed files:'
Get-ChildItem -File -Recurse $env:LOCALAPPDATADIR\Extensions | Select-Object -ExpandProperty FullName
displayName: 'Install extensions'
- powershell: |
function Copy-Symbols {
param ($source, $destination)
$extensionDirs = Get-ChildItem -Path $env:LOCALAPPDATADIR\Extensions\$destination\*
foreach ($pdb in Get-ChildItem -Path AudioWorks\src\Extensions\*\bin\$env:BUILDCONFIGURATION\$source\* -Filter AudioWorks.Extensions.*.pdb) {
$extensionDir = $extensionDirs | Where-Object -Property Name -Like "$($pdb.Name -replace '.pdb').*"
Copy-Item -Path $pdb.FullName -Destination $extensionDir -PassThru | % { Write-Host $_.FullName }
}
}
Write-Host 'Copied symbols:'
Copy-Symbols net6.0 net6.0
Copy-Symbols netstandard2.0 netcoreapp3.1
Copy-Symbols netstandard2.0 net48
displayName: 'Copy symbols to extension directories'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Common.Tests\AudioWorks.Common.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Common on .NET 6.0'
arguments: '--framework net6.0 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]*'
displayName: 'Test AudioWorks.Common on .NET 6.0'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Common.Tests\AudioWorks.Common.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Common on .NET Core 3.1'
arguments: '--framework netcoreapp3.1 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]*'
displayName: 'Test AudioWorks.Common on .NET Core 3.1'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Common.Tests\AudioWorks.Common.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Common on .NET Framework 4.8'
arguments: '--framework net462 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]*'
displayName: 'Test AudioWorks.Common on .NET Framework 4.8'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Extensibility.Tests\AudioWorks.Extensibility.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Extensibility on .NET 6.0'
arguments: '--framework net6.0 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]*'
displayName: 'Test AudioWorks.Extensibility on .NET 6.0'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Extensibility.Tests\AudioWorks.Extensibility.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Extensibility on .NET Core 3.1'
arguments: '--framework netcoreapp3.1 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]*'
displayName: 'Test AudioWorks.Extensibility on .NET Core 3.1'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Extensibility.Tests\AudioWorks.Extensibility.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Extensibility on .NET Framework 4.8'
arguments: '--framework net462 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]*'
displayName: 'Test AudioWorks.Extensibility on .NET Framework 4.8'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Api.Tests\AudioWorks.Api.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Api on .NET 6.0'
arguments: '--framework net6.0 --configuration $(buildConfiguration) --filter "FullyQualifiedName!~AudioWorks.Api.Tests.ExtensionInstallerTests" --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]* DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory=$(localAppDataDir)\Extensions\net6.0\*'
displayName: 'Test AudioWorks.Api on .NET 6.0'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Api.Tests\AudioWorks.Api.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Api on .NET Core 3.1'
arguments: '--framework netcoreapp3.1 --configuration $(buildConfiguration) --filter "FullyQualifiedName!~AudioWorks.Api.Tests.ExtensionInstallerTests" --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]* DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory=$(localAppDataDir)\Extensions\netcoreapp3.1\*'
displayName: 'Test AudioWorks.Api on .NET Core 3.1'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Api.Tests\AudioWorks.Api.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Api on .NET Framework 4.8'
arguments: '--framework net462 --configuration $(buildConfiguration) --filter "FullyQualifiedName!~AudioWorks.Api.Tests.ExtensionInstallerTests" --no-build --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]* DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory=$(localAppDataDir)\Extensions\net48\*'
displayName: 'Test AudioWorks.Api on .NET Framework 4.8'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Commands.Tests\AudioWorks.Commands.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Commands on .NET 6.0'
arguments: '--framework net6.0 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]* DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory=$(Build.SourcesDirectory)\AudioWorks\tests\AudioWorks.Commands.Tests\bin\$(buildConfiguration)\net6.0\AudioWorks.Commands\net6.0'
displayName: 'Test AudioWorks.Commands on .NET 6.0'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Commands.Tests\AudioWorks.Commands.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Commands on .NET Core 3.1'
arguments: '--framework netcoreapp3.1 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]* DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory=$(Build.SourcesDirectory)\AudioWorks\tests\AudioWorks.Commands.Tests\bin\$(buildConfiguration)\netcoreapp3.1\AudioWorks.Commands\netcoreapp3.1'
displayName: 'Test AudioWorks.Commands on .NET Core 3.1'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: 'AudioWorks\tests\AudioWorks.Commands.Tests\AudioWorks.Commands.Tests.csproj'
publishTestResults: 'true'
testRunTitle: 'AudioWorks.Commands on .NET Framework 4.8'
arguments: '--framework net462 --configuration $(buildConfiguration) --no-build --collect:"XPlat Code Coverage" -- RunConfiguration.DisableAppDomain=true DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Exclude=[AudioWorks.*.Tests]*,[AudioWorks.TestUtilities]* DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.IncludeDirectory=$(Build.SourcesDirectory)\AudioWorks\tests\AudioWorks.Commands.Tests\bin\$(buildConfiguration)\net462\AudioWorks.Commands\net462'
displayName: 'Test AudioWorks.Commands on .NET Framework 4.8'
- task: reportgenerator@5
inputs:
reports: '$(Agent.TempDirectory)\*\coverage.cobertura.xml'
targetdir: 'reports\coverage'
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
displayName: 'Generate code coverage report'
- task: PublishCodeCoverageResults@1
inputs:
codecoverageTool: 'cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)\reports\coverage\Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)\reports\coverage'
displayName: 'Publish code coverage results'
- task: CopyFiles@2
inputs:
contents: |
AudioWorks\src\*\bin\$(buildConfiguration)\*.nupkg
AudioWorks\src\*\bin\$(buildConfiguration)\*.snupkg
targetFolder: '$(Build.ArtifactStagingDirectory)\releases\core'
flattenFolders: true
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
displayName: 'Copy core libraries to artifacts directory'
- task: CopyFiles@2
inputs:
contents: |
AudioWorks\src\Extensions\**\*.nupkg
AudioWorks\src\Extensions\**\*.snupkg
targetFolder: '$(Build.ArtifactStagingDirectory)\releases\extensions'
flattenFolders: true
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
displayName: 'Copy extensions to artifacts directory'
- task: CopyFiles@2
inputs:
contents: 'AudioWorks\src\AudioWorks.Commands\bin\$(buildConfiguration)\AudioWorks.Commands\**'
targetFolder: '$(Build.ArtifactStagingDirectory)\releases\module'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
displayName: 'Copy PowerShell module to artifacts directory'
- task: PublishBuildArtifacts@1
displayName: 'Publish artifacts'