-
-
Notifications
You must be signed in to change notification settings - Fork 492
/
Copy pathazure-pipelines.yml
176 lines (171 loc) · 5.77 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Azure Pipelines documentation https://aka.ms/yaml
trigger:
branches:
include:
- "main"
tags:
include:
- "*"
pr:
branches:
include:
- "*"
variables:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Set the build number in MinVer.
MINVERBUILDMETADATA: build.$(Build.BuildId)
stages:
- stage: Build
jobs:
- job: Build
strategy:
matrix:
Linux:
matrixName: Ubuntu
vmImageName: ubuntu-latest
Mac:
matrixName: Mac
vmImageName: macos-latest
Windows:
matrixName: Windows
vmImageName: windows-latest
pool:
vmImage: $(vmImageName)
timeoutInMinutes: 20
steps:
- checkout: self
lfs: true
- task: UseDotNet@2
displayName: "Install .NET Core 3.1 SDK"
inputs:
packageType: "sdk"
version: 3.1.x
- task: UseDotNet@2
displayName: "Install .NET Core 5.0 SDK"
inputs:
packageType: "sdk"
version: 5.0.x
- task: UseDotNet@2
displayName: "Install .NET Core SDK"
inputs:
packageType: "sdk"
useGlobalJson: true
- pwsh: "dotnet tool restore"
displayName: "Dotnet Tool Restore"
failOnStderr: true
- pwsh: "dotnet cake --target=Build"
displayName: "Dotnet Cake Build"
failOnStderr: true
- pwsh: "dotnet cake --target=Pack"
displayName: "Dotnet Cake Pack"
failOnStderr: true
- publish: "./Artefacts"
artifact: $(matrixName)
displayName: "Publish Artefacts"
- stage: Test
jobs:
- job: Test
strategy:
matrix:
"API-Linux":
vmImageName: ubuntu-latest
template: "API"
# "API-MacOS":
# vmImageName: macos-latest
# template: "API"
"API-Windows":
vmImageName: windows-latest
template: "API"
"GraphQL-Linux":
vmImageName: ubuntu-latest
template: "GraphQL"
# "GraphQL-MacOS":
# vmImageName: macos-latest
# template: "GraphQL"
"GraphQL-Windows":
vmImageName: windows-latest
template: "GraphQL"
"Orleans-Linux":
vmImageName: ubuntu-latest
template: "Orleans"
# "Orleans-MacOS":
# vmImageName: macos-latest
# template: "Orleans"
"Orleans-Windows":
vmImageName: windows-latest
template: "Orleans"
"NuGet-Linux":
vmImageName: ubuntu-latest
template: "NuGet"
# "NuGet-MacOS":
# vmImageName: macos-latest
# template: "NuGet"
"NuGet-Windows":
vmImageName: windows-latest
template: "NuGet"
pool:
vmImage: $(vmImageName)
timeoutInMinutes: 30
steps:
- checkout: self
lfs: true
- task: UseDotNet@2
displayName: "Install .NET Core 3.1 SDK"
inputs:
packageType: "sdk"
version: 3.1.x
- task: UseDotNet@2
displayName: "Install .NET Core 5.0 SDK"
inputs:
packageType: "sdk"
version: 5.0.x
- task: UseDotNet@2
displayName: "Install .NET Core SDK"
inputs:
packageType: "sdk"
useGlobalJson: true
- pwsh: "dotnet tool restore"
displayName: "Dotnet Tool Restore"
failOnStderr: true
- pwsh: "dotnet cake --target=Build"
displayName: "Dotnet Cake Build"
failOnStderr: true
- pwsh: "dotnet cake --target=InstallDeveloperCertificate"
displayName: "Dotnet Cake InstallDeveloperCertificate"
failOnStderr: true
- pwsh: "dotnet cake --target=Test --template=$(template)"
displayName: "Dotnet Cake Test"
failOnStderr: true
- task: PublishTestResults@2
displayName: "Publish Test Results"
inputs:
testResultsFormat: "VSTest"
testResultsFiles: "**/*.trx"
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: cobertura
summaryFileLocation: "**/*.cobertura.xml"
- stage: Deploy
jobs:
- deployment: AzureArtefacts
displayName: "Azure Artefacts"
condition: ne(variables['Build.Reason'], 'PullRequest')
pool:
vmImage: windows-latest
environment: "Azure Artefacts"
strategy:
runOnce:
deploy:
steps:
- task: NuGetToolInstaller@1
displayName: "NuGet Install"
- task: NuGetAuthenticate@0
displayName: "NuGet Authenticate"
- pwsh: nuget push $(Agent.BuildDirectory)\Windows\*.nupkg -Source https://pkgs.dev.azure.com/dotnet-boxed/_packaging/dotnet-boxed/nuget/v3/index.json -ApiKey AzureArtifacts -SkipDuplicate
displayName: "NuGet Push"
failOnStderr: true