-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines-sonarcloud.yml
71 lines (61 loc) · 2.2 KB
/
azure-pipelines-sonarcloud.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
# 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
- main
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'Sonar HateoasNet'
organization: 'f500510f-d3cc-4979-8ba0-2e70d2c15da8'
scannerMode: 'MSBuild'
projectKey: 'hateoas-net-f500510f-d3cc-4979-8ba0-2e70d2c15da8'
projectName: 'HateoasNet'
extraProperties: |
sonar.exclusions=**/obj/**,**/*.dll,**.Sample/**, **.Tests/,HateoasNet/DependencyInjection/**
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx
- task: DotNetCoreCLI@2
displayName: Restore
inputs:
command: restore
projects: |
**/HateoasNet.csproj
**/*[Tt]ests.csproj
vstsFeed: '95c0ead5-2af5-438e-a6c1-67a6151c2e98/614ce658-eeff-4b3e-bb0f-79cd9396a8e1'
verbosityRestore: Quiet
- task: DotNetCoreCLI@2
displayName: Build
inputs:
projects: |
**/HateoasNet.csproj
**/*[Tt]ests.csproj
arguments: '--configuration $(BuildConfiguration) --no-restore /p:DeployOnBuild=true /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip"'
- task: VSTest@2
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*[Tt]ests.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
runOnlyImpactedTests: false
runInParallel: true
codeCoverageEnabled: true
testRunTitle: 'VS Tests check'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
diagnosticsEnabled: true
- task: SonarCloudAnalyze@1
- task: SimondeLang.sonarcloud-buildbreaker.sonar-buildbreaker.sonarcloud-buildbreaker@2
displayName: 'Break build on quality gate failure'
inputs:
SonarCloud: 'Sonar HateoasNet'
organization: 'f500510f-d3cc-4979-8ba0-2e70d2c15da8'