-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
98 lines (77 loc) · 2.94 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
name: $(Build.DefinitionName)-$(date:yyyyMMdd)$(rev:.r)
resources:
- repo: self
trigger: none
variables:
buildConfiguration: 'Release'
phases:
- phase: Phase_1
displayName: Windows
condition: succeededOrFailed()
queue:
name: Hosted VS2017
steps:
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'Dotnet $(buildConfiguration) Build'
- script: |
mkdir $(Build.SourcesDirectory)\results
dotnet test -l trx -r "$(Build.SourcesDirectory)\results" /p:CollectCoverage=true /p:CoverletOutput="$(Build.SourcesDirectory)\results\coverage" test\Lemonad.ErrorHandling.Unit
dotnet test -l trx -r "$(Build.SourcesDirectory)\results" /p:CollectCoverage=true /p:CoverletOutput="$(Build.SourcesDirectory)\results\coverage" /p:MergeWith="$(Build.SourcesDirectory)\results\coverage.json" /p:CoverletOutputFormat="cobertura" .\test\Lemonad.ErrorHandling.Integration
dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.4
.\reportgenerator "-reports:$(Build.SourcesDirectory)\results\coverage.cobertura.xml" "-targetdir:results" "-reporttypes:HTMLInline;HTMLChart"
displayName: 'Unit testing'
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(Build.SourcesDirectory)\results\coverage.cobertura.xml
reportDirectory: $(Build.SourcesDirectory)\results
codecoverageTool: cobertura
- task: DotNetCoreCLI@2
inputs:
command: publish
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
projects: test\Lemonad.ErrorHandling.Unit\Lemonad.ErrorHandling.Unit.csproj
publishWebProjects: false
modifyOutputPath: true
zipAfterPublish: true
- phase: Phase_2
displayName: Mac
condition: succeededOrFailed()
queue:
name: Hosted macOS
steps:
- task: DotNetCoreCLI@2
displayName: 'Dotnet $(buildConfiguration) Build'
inputs:
projects: |
src/**/*.csproj
test/**/*.csproj
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Dotnet $(buildConfiguration) Test'
inputs:
command: test
projects: 'test/Lemonad.ErrorHandling.Unit/**/*.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'
- phase: Phase_3
displayName: Ubuntu
condition: succeeded()
queue:
name: Hosted Ubuntu 1604
steps:
- task: DotNetCoreCLI@2
displayName: 'Dotnet $(buildConfiguration) Build'
inputs:
projects: |
src/**/*.csproj
test/**/*.csproj
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Dotnet $(buildConfiguration) Test'
inputs:
command: test
projects: 'test/Lemonad.ErrorHandling.Unit/**/*.csproj'
arguments: '--configuration $(buildConfiguration) --no-build'