forked from stryker-mutator/stryker-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
233 lines (193 loc) · 6.66 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
name: $(PackageVersion).$(VersionBuildNumber)
trigger:
batch: true
branches:
include:
- refs/heads/master
- refs/tags/*
resources:
- repo: self
clean: true
variables:
PackageVersion: '0.7.0'
VersionBuildNumber: $[counter('$(PackageVersion)', 1)]
PreReleaseVersion: $(PackageVersion)-beta.$(VersionBuildNumber)
ProjectsToPack: src/Stryker.Core/Stryker.Core/Stryker.Core.csproj;src/Stryker.CLI/Stryker.CLI/Stryker.CLI.csproj
IntegrationTestPath: integrationtests/IntegrationTests/ExampleProject.XUnit
IntegrationTestProject: $(IntegrationTestPath)/ExampleProject.XUnit.csproj
PreReleaseFeed: https://www.myget.org/F/stryker-mutator-integrationtest
PreReleaseFeedUri: https://www.myget.org/F/stryker-mutator-integrationtest/api/v3/index.json
jobs:
- job: PublishPreRelease
displayName: Prepare Pre-Release package
pool:
name: Hosted VS2017
steps:
- task: SonarSource.sonarcloud.14d9cde6-c1da-4d55-aa01-2965cd301255.SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: 'SonarCloud stryker-net'
organization: 'stryker-net'
projectKey: 'stryker-net.stryker-net'
projectName: Stryker.NET
projectVersion: '$(PackageVersion)'
- task: DotNetCoreCLI@2
displayName: 'Build the CLI Solution for Analysis'
inputs:
projects: '**/Stryker.CLI.sln'
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: test
projects: 'src/**/*.UnitTest.csproj'
publishTestResults: false
arguments: '--no-build --logger trx --collect "Code coverage" --results-directory $(Common.TestResultsDirectory) '
- task: SonarSource.sonarcloud.ce096e50-6155-4de8-8800-4221aaeed4a1.SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
- task: SonarSource.sonarcloud.38b27399-a642-40af-bb7d-9971f69712e8.SonarCloudPublish@1
displayName: 'Publish Quality Gate Result'
- task: DotNetCoreCLI@2
displayName: 'Pack pre-release packages'
inputs:
command: pack
nobuild: true
versioningScheme: byEnvVar
versionEnvVar: PreReleaseVersion
packagesToPack: $(ProjectsToPack)
packDirectory: $(Build.ArtifactStagingDirectory)/pre-release
- task: DotNetCoreCLI@2
displayName: 'Publish pre-release packages'
inputs:
command: custom
custom: 'nuget'
arguments: 'push StrykerMutator.*$(PreReleaseVersion).nupkg -s $(PreReleaseFeed) -k $(PreReleaseFeedKey)'
workingDirectory: '$(Build.ArtifactStagingDirectory)/pre-release'
- job: WaitOnMyGetProcessing
displayName: Wait on pre-release packages to be processed on MyGet
dependsOn: PublishPreRelease
pool:
name: server
steps:
- task: Delay@1
inputs:
delayForMinutes: '2'
- job: WindowsTests
displayName: Run tests on Windows
dependsOn: WaitOnMyGetProcessing
condition: succeeded()
pool:
name: Hosted VS2017
steps:
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: test
projects: 'src/**/*.UnitTest.csproj'
- task: DotNetCoreCLI@2
displayName: 'Install pre-release package in integration test project'
inputs:
command: custom
custom: add
arguments: $(IntegrationTestProject) package StrykerMutator.DotNetCoreCli -n -v $(PreReleaseVersion) -s $(PreReleaseFeedUri)
- script: 'node prepare-integrationtest.js $(PreReleaseVersion)'
displayName: 'Update stryker integration test with pre-release'
- task: DotNetCoreCLI@2
displayName: 'Restore pre-release packages in integrationtest project'
inputs:
command: custom
custom: restore
projects: '$(IntegrationTestProject)'
arguments: '-s $(PreReleaseFeedUri)'
- task: DotNetCoreCLI@2
displayName: 'Run integration test'
inputs:
command: custom
custom: stryker
workingDirectory: $(IntegrationTestPath)
- job: LinuxTests
displayName: Run tests on Linux
dependsOn: WaitOnMyGetProcessing
condition: succeeded()
pool:
name: Hosted Ubuntu 1604
steps:
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: test
projects: 'src/**/*.UnitTest.csproj'
- task: DotNetCoreCLI@2
displayName: 'Install pre-release package in integration test project'
inputs:
command: custom
custom: add
arguments: $(IntegrationTestProject) package StrykerMutator.DotNetCoreCli -n -v $(PreReleaseVersion) -s $(PreReleaseFeedUri)
- script: 'node prepare-integrationtest.js $(PreReleaseVersion)'
displayName: 'Update stryker integration test with pre-release'
- task: DotNetCoreCLI@2
displayName: 'Restore pre-release packages in integrationtest project'
inputs:
command: custom
custom: restore
projects: '$(IntegrationTestProject)'
arguments: '-s $(PreReleaseFeedUri)'
- task: DotNetCoreCLI@2
displayName: 'Run integration test'
inputs:
command: custom
custom: stryker
workingDirectory: $(IntegrationTestPath)
- job: MacOsTests
displayName: Run tests on Mac OS
dependsOn: WaitOnMyGetProcessing
condition: succeeded()
pool:
name: Hosted macOS
steps:
- task: DotNetCoreCLI@2
displayName: 'Run unit tests'
inputs:
command: test
projects: 'src/**/*.UnitTest.csproj'
- task: DotNetCoreCLI@2
displayName: 'Install pre-release package in integration test project'
inputs:
command: custom
custom: add
arguments: $(IntegrationTestProject) package StrykerMutator.DotNetCoreCli -n -v $(PreReleaseVersion) -s $(PreReleaseFeedUri)
- script: 'node prepare-integrationtest.js $(PreReleaseVersion)'
displayName: 'Update stryker integration test with pre-release'
- task: DotNetCoreCLI@2
displayName: 'Restore pre-release packages in integrationtest project'
inputs:
command: custom
custom: restore
projects: '$(IntegrationTestProject)'
arguments: '-s $(PreReleaseFeedUri)'
- task: DotNetCoreCLI@2
displayName: 'Run integration test'
inputs:
command: custom
custom: stryker
workingDirectory: $(IntegrationTestPath)
- job: PublishRelease
displayName: Publish Release Artifacts
dependsOn:
- WindowsTests
- LinuxTests
- MacOsTests
condition: and(succeeded(), eq(variables['build.sourcebranch'], 'refs/heads/master'))
pool:
name: Hosted VS2017
steps:
- task: DotNetCoreCLI@2
displayName: 'Pack release package'
inputs:
command: pack
nobuild: false
packagesToPack: $(ProjectsToPack)
packDirectory: $(Build.ArtifactStagingDirectory)/release
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: $(Build.ArtifactStagingDirectory)/release