-
Notifications
You must be signed in to change notification settings - Fork 10
/
azure-pipelines.yml
82 lines (69 loc) · 1.88 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
trigger:
branches:
include:
- master
tags:
include:
- '*'
paths:
exclude:
- README.md
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: '$(imageName)'
timeoutInMinutes: 20
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: UseGitVersion@5
inputs:
versionSpec: '5.x'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '3.1.x'
- script: echo %Action%%BuildVersion%
displayName: 'Set build version'
env:
Action: '##vso[build.updatebuildnumber]'
BuildVersion: $(GitVersion.SemVer)
condition: eq(variables['imageName'], 'windows-latest')
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: 'build'
projects: '$(solution)'
arguments: '-c $(buildConfiguration) -p:Version=$(GitVersion.SemVer)'
- task: DotNetCoreCLI@2
displayName: dotnet test
inputs:
command: 'test'
publishTestResults: true
arguments: -c $(buildConfiguration) --no-build /p:CollectCoverage=true;CoverletOutputFormat=cobertura;ExcludeByAttribute=Obsolete%2cGeneratedCode%2cCompilerGenerated
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '**/*.cobertura.xml'
- task: DotNetCoreCLI@2
displayName: dotnet pack
inputs:
command: 'pack'
packagesToPack: '**/*.csproj'
nobuild: true
includesymbols: true
buildProperties: SymbolPackageFormat=snupkg;Version=$(GitVersion.SemVer)
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'artifacts'
publishLocation: 'Container'
condition: eq(variables['imageName'], 'windows-latest')