forked from DevBetterCom/DevBetterWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.old-yml
89 lines (74 loc) · 2.21 KB
/
azure-pipelines.old-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
trigger:
branches:
include:
- master
- refs/tags/*
pr:
- master
pool:
vmImage: 'windows-2019'
variables:
buildConfiguration: 'Release'
buildPlatform: 'Any CPU'
solution: '**/*.sln'
disable.coverage.autogenerate: 'true'
steps:
# Prepare
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
- task: DotNetCoreCLI@2
displayName: 'dotnet version'
inputs:
command: custom
custom: '--version'
- task: DotNetCoreInstaller@0
displayName: 'Use .NET Core SDK 2.2.300'
inputs:
version: 2.2.300
- task: DotNetCoreCLI@2
displayName: 'dotnet info'
inputs:
command: custom
custom: '--info'
- task: DotNetCoreCLI@2
displayName: 'dotnet version'
inputs:
command: custom
custom: '--version'
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 4.9.3'
inputs:
versionSpec: 4.9.3
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
# Build
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
arguments: '--output $(Build.ArtifactStagingDirectory)'
# Run tests and create coverage report
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
projects: '**/*[Tt]ests/*.csproj'
arguments: '--configuration $(BuildConfiguration) --no-build /p:Exclude="[xunit.*]*%2c[DevBetterWeb.Tests]*" /p:AltCover=true /p:AltCoverForce=true /p:AltCoverCallContext=[Fact] /p:AltCoverXmlReport=..\target\reports\coverage\coverage.opencover.xml --collect "Code Coverage"'
- task: Palmmedia.reportgenerator.reportgenerator-build-release-task.reportgenerator@4
displayName: ReportGenerator
inputs:
reports: 'tests\target\reports\coverage\coverage.opencover.xml'
targetdir: 'tests\target\reports\coverage'
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
assemblyfilters: '-xunit*'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(build.sourcesdirectory)\tests\target\reports\coverage\Cobertura.xml'
reportDirectory: '$(build.sourcesdirectory)\tests\target\reports\coverage'