forked from Herdo/SSDTLifecycleExtension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
116 lines (104 loc) · 3.17 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
trigger:
branches:
include:
- master
pr:
branches:
include:
- master
variables:
isPullRequest: $[eq(variables['Build.Reason'], 'PullRequest')]
solution: '**/*.sln'
buildPlatform: 'AnyCPU'
buildConfiguration: 'Release'
jobs:
- job: Build
strategy:
matrix:
2019:
imageName: 'windows-2019'
extensionVersion: '2019'
vsVersion: '16.0'
2022:
imageName: 'windows-2022'
extensionVersion: '2022'
vsVersion: '17.0'
pool:
vmImage: $(imageName)
steps:
- task: SonarCloudPrepare@1
displayName: Prepare SonarCloud
# Pull Requests don't have access to secrets and therefore cannot use SonarCloud
condition: eq(variables.isPullRequest, False)
inputs:
projectName: 'SSDT Lifecycle Extension'
projectKey: 'SSDTLifecycleExtension'
projectVersion: '$(Build.BuildNumber)'
organization: 'herdo-github'
SonarCloud: 'SonarCloud-CodeAnalysis-Server'
extraProperties: |
sonar.exclusions=src\TestDatabase\**\*
- task: NuGetToolInstaller@0
displayName: NuGet Tool Installer
inputs:
versionSpec: '6.x'
checkLatest: true
- task: NuGetCommand@2
displayName: Restore NuGet packages
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
displayName: Build $(extensionVersion) version of extension
inputs:
solution: '**/*$(extensionVersion).csproj'
vsVersion: '$(vsVersion)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSBuild@1
displayName: Build sqlproj for tests
inputs:
solution: '**/*.sqlproj'
vsVersion: '$(vsVersion)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
displayName: Run tests
continueOnError: true
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\SSDTLifecycleExtension.UnitTests*.dll
searchFolder: '$(System.DefaultWorkingDirectory)'
runSettingsFile: '$(Build.SourcesDirectory)\src\UnitTestsShared\test.runsettings'
codeCoverageEnabled: true
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
minimumExpectedTests: 500
failOnMinTestsNotRun: true
- task: SonarCloudAnalyze@1
displayName: Run SonarCloud Analyzer
# Pull Requests don't have access to secrets and therefore cannot use SonarCloud
condition: eq(variables.isPullRequest, False)
- task: CopyFiles@2
name: CopyDeploymentData
displayName: Copy deployment data to artifact staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
deployment\*
README.md
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: CopyFiles@2
name: CopyVSIX
displayName: Copy VSIX to artifact staging directory
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
**\bin\Release\*.vsix
TargetFolder: '$(Build.ArtifactStagingDirectory)'
flattenFolders: true
- task: PublishBuildArtifacts@1
displayName: Publish VSIX build artifact
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: VSIX