-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
105 lines (88 loc) · 2.83 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
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- develop
pool:
vmImage: 'windows-2022'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
inputs:
versionSpec:
checkLatest: true
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
inputs:
updateAssemblyInfo: true
updateAssemblyInfoFilename: '$(Build.SourcesDirectory)\Toggly.FeatureManagement.NET\AssemblyInfo.cs'
additionalArguments: '/output buildserver'
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'ops-ai'
scannerMode: 'MSBuild'
projectKey: 'ops-ai_toggly-feature-management'
projectName: 'Toggly Feature Management'
projectVersion: '0.1'
extraProperties: |
sonar.dependencyCheck.reportPath=$(Agent.BuildDirectory)\dependency-check-report.xml
sonar.dependencyCheck.htmlReportPath=$(Agent.BuildDirectory)\dependency-check-report.html
sonar.coverageReportPaths=$(Agent.TempDirectory)\SonarQube.xml
sonar.coverage.exclusions="**Tests*.cs"
- task: dependency-check-build-task@5
inputs:
projectName: '$(Build.DefinitionName)'
scanPath: '$(build.artifactstagingdirectory)'
format: 'ALL'
additionalArguments: '--disableBundleAudit --disableRubygems --disableNodeJS --disablePyPkg --disablePyDist --out "$(Agent.BuildDirectory)"'
continueOnError: true
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '7.0.100'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: 'build'
projects: '$(solution)'
configuration: $(buildConfiguration)
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '$(solution)'
arguments: '-c $(buildConfiguration) --collect:"XPlat Code Coverage"'
- task: DotNetCoreCLI@2
inputs:
command: publish
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
projects: '$(solution)'
publishWebProjects: true
modifyOutputPath: true
zipAfterPublish: true
- task: reportgenerator@4
inputs:
reports: '$(Agent.TempDirectory)\**\coverage.cobertura.xml'
targetdir: '$(Agent.TempDirectory)\'
reporttypes: 'SonarQube'
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '$(solution)'
versioningScheme: 'byBuildNumber'
- task: SonarCloudAnalyze@1
- task: SonarCloudPublish@1
inputs:
pollingTimeoutSec: '300'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'