-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-validation-with-code-coverage.yml
More file actions
57 lines (48 loc) · 1.35 KB
/
Copy pathbuild-validation-with-code-coverage.yml
File metadata and controls
57 lines (48 loc) · 1.35 KB
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
trigger: none
pr:
branches:
include:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '8.0.x'
installationPath: $(Agent.ToolsDirectory)/dotnet
- task: DotNetCoreCLI@2
displayName: 'Restore NuGet packages'
inputs:
command: 'restore'
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Run tests with code coverage'
inputs:
command: 'test'
projects: 'Holocron.Tests/Holocron.Tests.csproj'
arguments: >
--configuration $(buildConfiguration)
--no-build
--logger "trx;LogFileName=$(Agent.TempDirectory)/test-results/test_results.trx"
--collect:"XPlat Code Coverage"
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '$(Agent.TempDirectory)/test-results/test_results.trx'
failTaskOnFailedTests: true
- task: PublishCodeCoverageResults@2
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: '$(Agent.TempDirectory)/**/coverage.cobertura.xml'
pathToSources: '$(Build.SourcesDirectory)'
failIfCoverageEmpty: true