-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
45 lines (38 loc) · 1.42 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
trigger:
- master
pool:
vmImage: 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
# Restore dependencies
- script: |
cd LiteDB.Wrapper
dotnet restore
displayName: 'Restore dependencies'
# Build project
- script: |
cd LiteDB.Wrapper
dotnet build --configuration $(buildConfiguration)
displayName: 'Build $(buildConfiguration)'
# Execute unit tests with coverage
- script: |
mkdir $(Build.SourcesDirectory)\results
dotnet test --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura LiteDB.Wrapper/LiteDB.Wrapper.Test
copy $(Build.SourcesDirectory)\LiteDB.Wrapper\LiteDB.Wrapper.Test\coverage.cobertura.xml $(Build.SourcesDirectory)\results
dotnet tool install dotnet-reportgenerator-globaltool --tool-path . --version 4.0.0-rc4
.\reportgenerator "-reports:$(Build.SourcesDirectory)\LiteDB.Wrapper\LiteDB.Wrapper.Test\coverage.cobertura.xml" "-targetdir:results" "-reporttypes:HTMLInline;HTMLChart"
displayName: 'Test with coverage'
# Publish test results
- task: PublishTestResults@2
displayName: 'Publist test results'
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
# Publish coverage results
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
summaryFileLocation: $(Build.SourcesDirectory)\results\coverage.cobertura.xml
reportDirectory: $(Build.SourcesDirectory)\results
codecoverageTool: cobertura