forked from SonarSource/sonar-scanner-msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines-external.yml
70 lines (68 loc) · 2.33 KB
/
azure-pipelines-external.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
pool:
vmImage: 'windows-latest'
variables:
- group: sonarsource-build-variables
stages:
- stage: buildAndTests
displayName: 'Build:'
jobs:
- job: build
pool:
vmImage: 'windows-latest'
displayName: 'Build, UT, analyze on SonarCloud'
variables:
solution: 'SonarScanner.MSBuild.sln'
tfsProcessorSolution: 'SonarScanner.MSBuild.TFS.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- checkout: self
- task: NuGetToolInstaller@1
displayName: 'Use NuGet 5.8.1'
inputs:
versionSpec: '5.8.1'
- task: DotNetCoreCLI@2
displayName: Dotnet restore $(tfsProcessorSolution)
inputs:
command: 'restore'
projects: '$(tfsProcessorSolution)'
feedsToUse: 'select'
- task: NuGetCommand@2
displayName: 'NuGet restore TFS Processor'
inputs:
command: 'restore'
restoreSolution: '$(tfsProcessorSolution)'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'Build $(tfsProcessorSolution)'
inputs:
command: 'build'
projects: '$(tfsProcessorSolution)'
arguments: '/m /p:DeployExtension=false /p:platform="$(BuildPlatform)" /p:configuration=$(BuildConfiguration) /p:ZipPackageCompressionLevel=normal'
- task: NuGetCommand@2
displayName: 'NuGet restore $(solution)'
inputs:
command: 'restore'
restoreSolution: '$(solution)'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: Dotnet restore $(solution)
inputs:
command: 'restore'
projects: '$(solution)'
feedsToUse: 'select'
- task: DotNetCoreCLI@2
displayName: 'Build $(solution)'
inputs:
command: 'build'
projects: '$(solution)'
arguments: '/m /p:DeployExtension=false /p:ZipPackageCompressionLevel=normal /p:configuration=$(BuildConfiguration) /p:platform="$(BuildPlatform)"'
- task: VSTest@2
displayName: 'Run Unit Tests'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\$(BuildConfiguration)\*\SonarScanner.MsBuild.*Test.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
codeCoverageEnabled: true