-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
95 lines (84 loc) · 2.81 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
83
84
85
86
87
88
89
90
91
92
93
94
95
name: $(ReleaseVersionNumber) Build $(Build)
variables:
ReleaseVersionNumber: 1.1.3
Build: $[counter(variables['ReleaseVersionNumber'], 1)]
PrereleaseVersionNumber: $(ReleaseVersionNumber)-dev$(Build)
AssemblyVersion: $(ReleaseVersionNumber).$(Build)
InformationalVersion: $(ReleaseVersionNumber) build $(Build)
trigger:
batch: true
branches:
include:
- master
paths:
include:
- src
pr:
branches:
include:
- master
paths:
include:
- src
- test
jobs:
- job:
displayName: "Build, Test, Package"
pool:
vmImage: windows-latest
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
feedsToUse: select
vstsFeed: "xpike-daily"
includeNuGetOrg: true
projects: |
**/*.csproj
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
arguments: --no-restore -c release -p:Version=$(AssemblyVersion) -p:"InformationalVersion=$(InformationalVersion)"
projects: |
src/**/*.csproj
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: test
publishTestResults: false
arguments: --no-restore -c debug --logger trx -r $(Agent.TempDirectory)/TestResults -p:CollectCoverage=true -p:CoverletOutput="$(Agent.TempDirectory)/TestResults/" -p:CoverletOutputFormat="json%2cCobertura" -p:MergeWith="$(Agent.TempDirectory)/TestResults/coverage.json"
projects: |
test/**/*.csproj
- task: PublishCodeCoverageResults@1
displayName: Publish code coverage results
inputs:
codeCoverageTool: "Cobertura"
summaryFileLocation: "$(Agent.TempDirectory)/TestResults/coverage.cobertura.xml"
- task: PublishTestResults@2
displayName: Publish test results
inputs:
searchFolder: $(Agent.TempDirectory)/TestResults
failTaskOnFailedTests: true
mergeTestResults: true
testResultsFormat: "VSTest"
testResultsFiles: "**/*.trx"
- task: DotNetCoreCLI@2
displayName: Package unstable
inputs:
command: custom
custom: pack
arguments: -c release --no-build -p:PackageVersion=$(PrereleaseVersionNumber) -o $(Build.ArtifactStagingDirectory)/unstable
projects: |
src/**/*.csproj
- task: DotNetCoreCLI@2
displayName: Package stable for Nuget
inputs:
command: custom
custom: pack
arguments: -c release --no-build -p:PackageVersion=$(ReleaseVersionNumber) -o $(Build.ArtifactStagingDirectory)/stable
projects: |
src/**/*.csproj
- task: PublishBuildArtifacts@1
displayName: Publish Build Artifact