-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
57 lines (52 loc) · 1.72 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
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
strategy:
matrix:
windows:
imageName: 'windows-latest'
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
trigger:
branches:
include:
- master
- develop
pool:
vmImage: $(imageName)
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
displayName: 'Install .NET SDK 6.0'
inputs:
packageType: 'sdk'
version: '6.0.x'
- task: DotNetCoreCLI@2
displayName: 'Restore Nuget Pacakges'
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'Build Projects'
- task: DotNetCoreCLI@2
displayName: 'Run Tests'
inputs:
command: 'test'
projects: '**/*.Tests/*.csproj'
arguments: '--configuration $(buildConfiguration) --logger="console;verbosity=detailed" --collect:"XPlat Code Coverage" --settings:"$(Build.SourcesDirectory)/coverlet.runsettings"'
# https://stackoverflow.com/questions/64592534/publish-a-pipeline-azure-devops-code-coverage-report
- task: DotNetCoreCLI@2
displayName: 'Install ReportGenerator Tool'
inputs:
command: 'custom'
custom: 'tool'
arguments: 'install --global dotnet-reportgenerator-globaltool'
- script: 'reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:"$(Build.ArtifactStagingDirectory)/coverlet" -reporttypes:"Cobertura" -verbosity:"Verbose"'
displayName: 'Merge Code Coverage Reports'
- task: PublishCodeCoverageResults@1
displayName: 'Publish Code Coverage Report'
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.ArtifactStagingDirectory)/coverlet/Cobertura.xml'