-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
140 lines (123 loc) · 4 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
trigger:
branches:
include:
- develop
- refs/pull/*
tags:
include:
- v*
variables:
buildConfiguration: 'Release'
netCoreSdk: '3.1.402'
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 'true'
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
jobs:
- job: 'build_lin'
displayName: "[Linux] Build & Test"
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
displayName: "Get .NET SDK"
inputs:
packageType: 'sdk'
version: '$(netCoreSdk)'
- script: |
dotnet tool restore
dotnet cake --bootstrap
displayName: "Install build tools"
- script: dotnet cake --target=Stage-Artifacts --configuration=$(buildConfiguration) --verbosity=diagnostic
displayName: "Build, test and stage artifacts"
- task: PublishTestResults@2
displayName: "Publish test results"
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: 'test_results'
failTaskOnFailedTests: true
publishRunAttachments: false
- task: PublishCodeCoverageResults@1
displayName: "Publish code coverage"
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: 'test_results/coverage/Cobertura.xml'
failIfCoverageEmpty: true
# We copy the artifacts as we can't specify filters in the publish task
- task: CopyFiles@2
displayName: "Prepare artifacts"
inputs:
sourceFolder: 'artifacts'
contents: |
*.zip
*.nupkg
*.snupkg
_site/**
targetFolder: $(Build.ArtifactStagingDirectory)
- task: PublishBuildArtifacts@1
displayName: "Publish artifacts"
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'artifacts'
publishLocation: 'Container'
- job: 'build_mac'
displayName: "[MacOS] Build & Test"
pool:
vmImage: 'macOs-latest'
steps:
- task: UseDotNet@2
displayName: "Get .NET SDK"
inputs:
packageType: 'sdk'
version: '$(netCoreSdk)'
- script: |
dotnet tool restore
dotnet cake --bootstrap
displayName: "Install build tools"
- script: dotnet cake --target=BuildTest --configuration=$(buildConfiguration) --verbosity=diagnostic
displayName: "Build & test"
- task: PublishTestResults@2
displayName: "Publish test results"
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: 'test_results'
failTaskOnFailedTests: true
publishRunAttachments: false
- job: 'build_win'
displayName: "[Windows] Build & Test"
pool:
vmImage: 'windows-latest'
steps:
- task: UseDotNet@2
displayName: "Get .NET SDK"
inputs:
packageType: 'sdk'
version: '$(netCoreSdk)'
- script: |
dotnet tool restore
dotnet cake --bootstrap
displayName: "Install build tools"
- script: dotnet cake --target="BuildTest" --configuration=$(buildConfiguration) --verbosity=diagnostic
displayName: "Build & test"
- task: PublishTestResults@2
displayName: "Publish test results"
inputs:
testResultsFormat: 'VSTest'
testResultsFiles: '*.trx'
searchFolder: 'test_results'
failTaskOnFailedTests: true
publishRunAttachments: false
- job: 'preview_release'
displayName: 'Publish preview release'
pool:
vmImage: 'ubuntu-latest'
dependsOn: ['build_win', 'build_lin', 'build_mac']
condition: "and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))"
steps:
- task: DownloadBuildArtifacts@0
displayName: 'Get build artifacts'
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'artifacts'
downloadPath: '$(Build.ArtifactStagingDirectory)'