-
-
Notifications
You must be signed in to change notification settings - Fork 272
/
azure-pipelines.yml.bak
88 lines (74 loc) · 2.35 KB
/
azure-pipelines.yml.bak
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
trigger:
branches:
include:
- master
- refs/tags/*
pr:
- master
pool:
vmImage: 'windows-2019'
variables:
buildConfiguration: 'Release'
buildPlatform: 'Any CPU'
solution: '**/*.sln'
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: 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: '$(Parameters.TestProjects)'
projects: '**/*[Tt]ests/*.csproj'
arguments: '--configuration $(BuildConfiguration) --no-build /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: 'src\target\reports\coverage\coverage.opencover.xml'
targetdir: 'src\target\reports\coverage'
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
assemblyfilters: '-xunit*'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage results'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(build.sourcesdirectory)\src\target\reports\coverage\Cobertura.xml'
reportDirectory: '$(build.sourcesdirectory)\src\target\reports\coverage'
- task: CopyFiles@2
displayName: 'Copy *.nupkg Files'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**\*.nupkg'
TargetFolder: '$(Build.ArtifactStagingDirectory)\Package'
flattenFolders: true
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
# Publish
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)\Package'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))