forked from wulfland/CodingDojo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
59 lines (48 loc) · 1.61 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
pr:
paths:
include:
- solutions/dotnet/**
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Debug'
steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'wulfland-github'
scannerMode: 'MSBuild'
projectKey: 'coding-dojo'
projectName: 'CodingDojo'
extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverage/coverage.opencover.xml'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.sln'
workingDirectory: 'solutions/dotnet'
displayName: 'Build **/*.sln'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: '**/*.sln'
arguments: '--logger trx --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=$(Build.SourcesDirectory)/coverage/'
publishTestResults: false
workingDirectory: 'solutions/dotnet'
displayName: 'Test **/.*sln'
- task: SonarCloudAnalyze@1
- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .
./reportgenerator "-reports:$(Build.SourcesDirectory)/coverage/coverage.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
displayName: 'Run Reportgenerator'
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- task: PublishCodeCoverageResults@1
inputs:
summaryFileLocation: $(Build.SourcesDirectory)/coverage/Cobertura/Cobertura.xml
reportDirectory: $(Build.SourcesDirectory)/coverage/Cobertura
codecoverageTool: cobertura