-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
57 lines (46 loc) · 1.54 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
name: $(GitVersion.FullSemVer)
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: Release
trigger:
batch: true
branches:
include:
- master
paths:
exclude:
- docs/*
- README.md
steps:
- checkout: self
clean: true
persistCredentials: true
- task: UseGitVersion@5
displayName: GitVersion
inputs:
versionSpec: '5.x'
- script: dotnet tool restore
displayName: 'dotnet tool restore'
- script: dotnet test -c $(buildConfiguration) --logger xunit -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura
displayName: 'dotnet test'
- script: dotnet pack ./src/MarkdownBuilder/MarkdownBuilder.csproj -c $(buildConfiguration) -o $(Build.ArtifactStagingDirectory)/out -p:Version=$(GitVersion.SemVer) --include-symbols
displayName: 'dotnet pack'
- task: PublishTestResults@2
displayName: 'publish test results'
inputs:
testRunner: xUnit
testResultsFiles: '**/TestResults.xml'
- script: dotnet tool run reportgenerator -reports:**/coverage.cobertura.xml -targetdir:tests/coverage -reportTypes:Cobertura
displayName: 'generate code coverage report'
- task: PublishCodeCoverageResults@1
displayName: 'publish code coverage'
inputs:
codeCoverageTool: cobertura
summaryFileLocation: '**/Cobertura.xml'
- task: PublishBuildArtifacts@1
displayName: 'publish artifact'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/out
ArtifactName: out