forked from OpenRIAServices/OpenRiaServices
-
Notifications
You must be signed in to change notification settings - Fork 15
/
azure-pipelines.yml
122 lines (103 loc) · 3.8 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
pool:
vmImage: 'windows-2019'
variables:
BuildConfiguration: 'release'
BuildPlatform: 'any cpu'
Solution: 'src\RiaServices.sln'
# Define the following variable for the build pipeline in order to enable sonarcloud analysis
# sonarcloud-endpoint: 'sonarcloud.io'
steps:
- task: NuGetToolInstaller@0
inputs:
versionSpec: 5.3.1
- task: GitVersion@4
displayName: GitVersion
inputs:
preferBundledVersion: true
- task: NuGetCommand@2
displayName: 'NuGet restore RiaServices.sln'
inputs:
restoreSolution: '$(Solution)'
configuration: '$(BuildConfiguration)'
- task: SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
condition: variables['sonarcloud-endpoint']
inputs:
SonarCloud: 'sonarcloud.io'
organization: openriaservices
projectKey: 'OpenRIAServices_OpenRiaServices'
projectName: OpenRiaServices
projectVersion: '$(GitVersion.NuGetVersion)'
extraProperties: |
# Additional properties that will be passed to the scanner,
# Put one key=value per line, example:
sonar.exclusions=src\VisualStudio/ItemTemplates/**,src\VisualStudio/Templates/**;
- task: VSBuild@1
displayName: 'Build solution RiaServices.sln'
inputs:
solution: '$(Solution)'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
maximumCpuCount: true
- powershell: |
sqllocaldb start MSSQLLocalDB
if (-not $?) { write-error "failed to start MSSQLLocalDB" }
.\Setup-TestDatabases.ps1
displayName: 'Setup database'
- task: VSTest@2
displayName: 'Run tests'
inputs:
testAssemblyVer2: |
**\bin\$(BuildConfiguration)\**\OpenRiaServices.DomainServices.*Test.dll
src\VisualStudio\**\bin\$(BuildConfiguration)\**\OpenRiaServices.VisualStudio.*Test.dll
!src\VisualStudio\**\bin\$(BuildConfiguration)\**\OpenRiaServices.DomainServices.*Test.dll
!**\obj\**
runOnlyImpactedTests: false
runInParallel: true
runSettingsFile: 'src\test.runsettings'
codeCoverageEnabled: true
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
diagnosticsEnabled: false
timeoutInMinutes: 25
- task: SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
continueOnError: true
condition: and(variables['sonarcloud-endpoint'], or(succeeded(), and(succeededOrFailed(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))))
- task: NuGetCommand@2
displayName: 'NuGet pack'
inputs:
command: pack
packagesToPack: 'NuGet\**\*.nuspec'
versioningScheme: byEnvVar
versionEnvVar: GitVersion.NuGetVersion
packDestination: '$(Build.ArtifactStagingDirectory)'
continueOnError: true
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: CopyFiles@2
displayName: 'Copy VS Extension: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(build.sourcesdirectory)'
Contents: |
src\VisualStudio\Installer\bin\$(BuildConfiguration)\*.vsix
src\VisualStudio\Installer\publishManifest.json
src\VisualStudio\Installer\assets\**
TargetFolder: '$(build.artifactstagingdirectory)'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
- task: CopyFiles@2
displayName: 'Copy dump files to $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: |
**\*.dmp
TargetFolder: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
- task: SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
continueOnError: true
condition: and(variables['sonarcloud-endpoint'], or(succeeded(), and(succeededOrFailed(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))))