-
Notifications
You must be signed in to change notification settings - Fork 165
/
azure-pipelines.yml
86 lines (75 loc) · 1.98 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
pool:
name: Azure Pipelines
vmImage: 'windows-2022'
demands:
- msbuild
- visualstudio
- vstest
variables:
solution: 'NLog.Web.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@0
displayName: 'Use NuGet 6.x'
inputs:
versionSpec: 6.x
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(solution)'
verbosityRestore: Quiet
- task: SonarCloudPrepare@2
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: Sonarcloud
organization: nlog
projectKey: nlog.web
projectName: 'NLog Web'
projectVersion: '$(Build.BuildId)'
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(solution)'
msbuildArgs: '-v:m'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
maximumCpuCount: true
- task: VSTest@2
displayName: 'VsTest - testAssemblies'
inputs:
testAssemblyVer2: |
**\$(buildConfiguration)\**\NLog.*.Tests.dll
!**\obj\**
runOnlyImpactedTests: false
runInParallel: false
codeCoverageEnabled: true
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
failOnMinTestsNotRun: true
rerunFailedTests: true
rerunMaxAttempts: 5
- task: PublishSymbols@2
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
PublishSymbols: false
continueOnError: true
- task: CopyFiles@2
displayName: 'Nupkg files to artifacts'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: |
artifacts\*.nupkg
artifacts\*.snupkg
TargetFolder: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
- task: SonarCloudAnalyze@2
displayName: 'Run Code Analysis'
- task: SonarCloudPublish@2
displayName: 'Publish Quality Gate Result'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()