-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
215 lines (183 loc) · 6.7 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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
variables:
buildConfiguration: 'Release'
jobs:
- job: Build
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
windows:
imageName: 'windows-latest'
pool:
vmImage: $(imageName)
steps:
- task: UseDotNet@2
displayName: 'Use dotnet sdk 2.x'
inputs:
version: 2.x
- task: UseDotNet@2
displayName: 'Use dotnet sdk 3.x'
inputs:
version: 3.x
- task: GitVersion@5
inputs:
runtime: 'core'
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'manandre'
scannerMode: 'MSBuild'
projectKey: 'manandre_FollowingFileStream'
projectVersion: '$(Build.BuildId)'
extraProperties: 'sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/coverage/coverage.netcoreapp3.0.opencover.xml'
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
versioningScheme: byBuildNumber
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: 'All.sln' # Mandatory for SonarQube !?!
arguments: '--configuration $(BuildConfiguration) /p:Version=$(GitVersion.NuGetVersion)'
versioningScheme: byBuildNumber
- task: DotNetCoreCLI@2
displayName: Test
inputs:
command: 'test'
projects: '**/*.Tests.csproj'
arguments: '--configuration $(buildConfiguration) --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=$(Build.SourcesDirectory)/coverage/'
publishTestResults: false
- task: PublishTestResults@2
displayName: Publish Test Results
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .
./reportgenerator "-reports:$(Build.SourcesDirectory)/coverage/coverage.netcoreapp3.0.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
condition: eq( variables['Agent.OS'], 'Linux' )
displayName: Run Reportgenerator on Linux
- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path .
.\reportgenerator.exe "-reports:$(Build.SourcesDirectory)/coverage/coverage.netcoreapp3.0.opencover.xml" "-targetdir:coverage/Cobertura" "-reporttypes:Cobertura;HTMLInline;HTMLChart"
condition: eq( variables['Agent.OS'], 'Windows_NT' )
displayName: Run Reportgenerator on Windows
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: $(Build.SourcesDirectory)/coverage/Cobertura/Cobertura.xml
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
- task: DotNetCoreCLI@2
displayName: Pack
inputs:
command: 'pack'
packagesToPack: 'FollowingFileStream/*.csproj'
nobuild: true
versioningScheme: 'byEnvVar'
versionEnvVar: 'GitVersion.NuGetVersion'
- task: PublishSymbols@2
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
SearchPattern: |
**/bin/**/FollowingFileStream.pdb
**/bin/**/FollowingFileStream.dll
IndexSources: false
SymbolServerType: 'TeamServices'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- job: SourceBrowser
displayName: Source Browser generation
pool:
vmImage: 'windows-latest'
steps:
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: 'restore'
projects: '**/*.SourceBrowser.csproj'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: 'build'
projects: '**/*.SourceBrowser.csproj'
arguments: '--configuration $(BuildConfiguration)'
- task: ArchiveFiles@2
displayName: Zip source browser website
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/FollowingFileStream.SourceBrowser/bin/Index'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/sourcebrowser_website.zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/sourcebrowser_website.zip'
ArtifactName: 'sourcebrowser_website'
publishLocation: 'Container'
- job: ApiDoc
displayName: API Documentation generation
pool:
vmImage: 'windows-latest'
steps:
- task: ChocolateyCommand@0
inputs:
command: 'install'
installPackageId: 'wkhtmltopdf'
- task: UseDotNet@2
displayName: 'Use dotnet sdk 2.x'
inputs:
version: 2.x
- task: UseDotNet@2
displayName: 'Use dotnet sdk 3.x'
inputs:
version: 3.x
# First restore to resolve external dependencies
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: 'restore'
projects: '**/FollowingFileStream.csproj'
feedsToUse: 'select'
- task: DocFxTask@0
inputs:
solution: 'FollowingFileStream.APIdoc/docfx.json'
- task: ArchiveFiles@2
displayName: Zip API documentation website
inputs:
rootFolderOrFile: '$(Build.SourcesDirectory)/FollowingFileStream.APIdoc/_site'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/apidoc_website.zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
displayName: Publish Website
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/apidoc_website.zip'
ArtifactName: 'apidoc_website'
publishLocation: 'Container'
- task: PublishBuildArtifacts@1
displayName: Publish PDF
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/FollowingFileStream.APIdoc/_site_pdf/FollowingFileStream.APIdoc_pdf.pdf'
ArtifactName: 'apidoc_pdf'
publishLocation: 'Container'