forked from mysql-net/MySqlConnector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
260 lines (251 loc) · 10 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
variables:
DotNetCoreSdkVersion: '7.x'
NUGET_PACKAGES: '$(Pipeline.Workspace)/.nuget/packages'
jobs:
- job: linux_build
displayName: 'Linux Build'
pool:
vmimage: 'ubuntu-20.04'
steps:
- template: '.ci/build-steps.yml'
- job: windows_build
displayName: 'Windows Build'
pool:
vmimage: 'windows-latest'
steps:
- template: '.ci/build-steps.yml'
- task: DotNetCoreCLI@2
displayName: 'Publish IntegrationTests (net472)'
inputs:
command: 'publish'
arguments: '-c Release -f net472 tests/IntegrationTests/IntegrationTests.csproj'
publishWebProjects: false
zipAfterPublish: false
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'IntegrationTests-net472-$(Agent.OS)'
targetPath: 'tests/IntegrationTests/bin/Release/net472/publish'
- job: windows_mysql_data
displayName: 'MySql.Data Tests'
pool:
vmimage: 'windows-2019'
steps:
- template: '.ci/install-mysql-windows.yml'
- task: CopyFiles@2
displayName: 'Copy config.json'
inputs:
sourceFolder: '.ci/config'
contents: 'config.json'
targetFolder: 'tests/IntegrationTests'
- task: UseDotNet@2
displayName: 'Install .NET Core 7.0'
inputs:
version: '7.0.x'
- task: UseDotNet@2
displayName: 'Install .NET Core'
inputs:
version: $(DotNetCoreSdkVersion)
- task: DotNetCoreCLI@2
displayName: 'MySql.Data unit tests'
inputs:
command: 'test'
arguments: 'tests\MySqlConnector.Tests\MySqlConnector.Tests.csproj -c MySqlData'
testRunTitle: 'MySql.Data unit tests'
- task: DotNetCoreCLI@2
displayName: 'MySql.Data integration tests'
inputs:
command: 'test'
arguments: 'tests\IntegrationTests\IntegrationTests.csproj -c MySqlData'
testRunTitle: 'MySql.Data integration tests'
env:
DATA__UNSUPPORTEDFEATURES: 'Ed25519,QueryAttributes,StreamingResults,UnixDomainSocket'
DATA__CONNECTIONSTRING: 'server=localhost;port=3306;user id=root;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600'
DATA__CERTIFICATESPATH: '$(Build.Repository.LocalPath)\.ci\server\certs\'
DATA__MYSQLBULKLOADERLOCALCSVFILE: '$(Build.Repository.LocalPath)\tests\TestData\LoadData_UTF8_BOM_Unix.CSV'
DATA__MYSQLBULKLOADERLOCALTSVFILE: '$(Build.Repository.LocalPath)\tests\TestData\LoadData_UTF8_BOM_Unix.TSV'
TF_BUILD: $(TF_BUILD)
- task: PublishTestResults@2
condition: always()
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/*.trx'
testRunTitle: 'MySql.Data Tests'
failTaskOnFailedTests: true
- job: linux_unit_tests
dependsOn: linux_build
displayName: 'Linux Unit Tests'
pool:
vmimage: 'ubuntu-20.04'
steps:
- template: '.ci/mysqlconnector-tests-steps.yml'
- job: windows_unit_tests
dependsOn: windows_build
displayName: 'Windows Tests'
pool:
vmimage: 'windows-2019'
steps:
- template: '.ci/install-mysql-windows.yml'
- task: UseDotNet@2
displayName: 'Install .NET Core 3.1'
inputs:
version: 3.1.x
packageType: runtime
- template: '.ci/mysqlconnector-tests-steps.yml'
- template: '.ci/conformance-test-steps.yml'
parameters:
image: 'mysql:8.0'
connectionString: 'server=localhost;port=3306;user id=mysqltest;password=test;database=conformance;ssl mode=none;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True'
- job: azure_mysql_integration_tests
condition: ne('True', variables['System.PullRequest.IsFork'])
displayName: 'Azure MySQL Integration Tests'
pool:
vmimage: 'windows-latest'
steps:
- task: PowerShell@2
displayName: Create Database
inputs:
targetType: inline
script: "mysql -u$(Azure MySQL Root User) -p$(Azure MySQL Root Password) -h '$(Azure MySQL Host)' -e 'create schema mysqltest_$(Build.BuildId) collate utf8mb4_0900_ai_ci;'"
- task: UseDotNet@2
displayName: 'Install .NET Core 7.0'
inputs:
version: 7.0.x
packageType: runtime
- task: UseDotNet@2
displayName: 'Install .NET Core'
inputs:
version: $(DotNetCoreSdkVersion)
- task: PowerShell@2
displayName: 'Copy Azure config'
inputs:
targetType: inline
script: Copy-Item -Path ".\.ci\config\config.ssl.json" -Destination ".\tests\IntegrationTests\config.json"
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
- task: DotNetCoreCLI@2
displayName: 'Integration tests (net7.0)'
inputs:
command: 'test'
projects: 'tests/IntegrationTests/IntegrationTests.csproj'
arguments: '-c Release -f net7.0 --no-restore'
testRunTitle: ${{ format('{0}, $(Agent.OS), {1}, {2}', 'Azure', 'net6.0', 'SSL') }}
env:
DATA__UNSUPPORTEDFEATURES: 'CachingSha2Password,Ed25519,GlobalLog,KnownCertificateAuthority,QueryAttributes,RsaEncryption,Sha256Password,StreamingResults,Timeout,Tls11,Tls13,UnixDomainSocket,ZeroDateTime'
DATA__CONNECTIONSTRING: "$(AzureConnectionString);database=mysqltest_$(Build.BuildId);ssl mode=Required;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True"
- task: PowerShell@2
displayName: Drop Database
condition: always()
inputs:
targetType: inline
script: "mysql -u$(Azure MySQL Root User) -p$(Azure MySQL Root Password) -h '$(Azure MySQL Host)' -e 'drop schema if exists mysqltest_$(Build.BuildId);'"
- job: windows_integration_tests_1
displayName: 'Windows Integration Tests (Part 1)'
pool:
vmimage: 'windows-2019'
steps:
- template: '.ci/install-mysql-windows.yml'
- task: UseDotNet@2
displayName: 'Install .NET Core'
inputs:
version: $(DotNetCoreSdkVersion)
- task: CopyFiles@2
displayName: 'Copy config.json'
inputs:
sourceFolder: '.ci/config'
contents: 'config.json'
targetFolder: 'tests/IntegrationTests'
- task: PowerShell@2
displayName: 'Remove target frameworks'
inputs:
targetType: 'inline'
script: '((Get-Content .\tests\IntegrationTests\IntegrationTests.csproj -Raw) -replace(''<TargetFrameworks>.*</TargetFrameworks>'', ''<TargetFrameworks>net472;net7.0</TargetFrameworks>'')) | Set-Content .\tests\IntegrationTests\IntegrationTests.csproj'
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
- task: DotNetCoreCLI@2
displayName: 'Integration tests (net472/net7.0)'
inputs:
command: 'test'
projects: 'tests/IntegrationTests/IntegrationTests.csproj'
arguments: '-c Release --no-restore'
testRunTitle: ${{ format('{0}, $(Agent.OS), {1}, {2}', 'mysql:8.0', 'net472/net7.0', 'No SSL') }}
env:
DATA__UNSUPPORTEDFEATURES: 'Ed25519,QueryAttributes,StreamingResults,Tls11,UnixDomainSocket'
DATA__CONNECTIONSTRING: 'server=localhost;port=3306;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True;UseCompression=True'
- job: windows_integration_tests_2
displayName: 'Windows Integration Tests (Part 2)'
pool:
vmimage: 'windows-2019'
steps:
- template: '.ci/install-mysql-windows.yml'
- task: UseDotNet@2
displayName: 'Install .NET Core 6.0'
inputs:
version: 6.0.x
packageType: runtime
- task: UseDotNet@2
displayName: 'Install .NET Core'
inputs:
version: $(DotNetCoreSdkVersion)
- script: copy .ci\config\config.json tests\IntegrationTests\config.json
displayName: 'Copy config.json'
- task: PowerShell@2
displayName: 'Remove target frameworks'
inputs:
targetType: 'inline'
script: '((Get-Content .\tests\IntegrationTests\IntegrationTests.csproj -Raw) -replace(''<TargetFrameworks>.*</TargetFrameworks>'', ''<TargetFrameworks>net6.0</TargetFrameworks>'')) | Set-Content .\tests\IntegrationTests\IntegrationTests.csproj'
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
- task: DotNetCoreCLI@2
displayName: 'Integration tests (net6.0)'
inputs:
command: 'test'
projects: 'tests/IntegrationTests/IntegrationTests.csproj'
arguments: '-c Release --no-restore'
testRunTitle: ${{ format('{0}, $(Agent.OS), {1}, {2}', 'mysql:8.0', 'net6.0', 'No SSL') }}
env:
DATA__UNSUPPORTEDFEATURES: 'Ed25519,QueryAttributes,StreamingResults,Tls11,UnixDomainSocket'
DATA__CONNECTIONSTRING: 'server=localhost;port=3306;user id=mysqltest;password=test;database=mysqltest;ssl mode=none;DefaultCommandTimeout=3600;AllowPublicKeyRetrieval=True'
- job: linux_integration_tests
dependsOn: linux_build
displayName: 'Linux Tests'
pool:
vmimage: 'ubuntu-20.04'
strategy:
matrix:
'MySQL 5.6':
image: 'mysql:5.6'
connectionStringExtra: ''
unsupportedFeatures: 'CachingSha2Password,Ed25519,Json,LargePackets,QueryAttributes,ResetConnection,SessionTrack,Sha256Password,Tls11,Tls13,UuidToBin'
'MySQL 5.7':
image: 'mysql:5.7'
connectionStringExtra: 'Tls Cipher Suites=TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256'
unsupportedFeatures: 'CachingSha2Password,Ed25519,QueryAttributes,Tls11,Tls13,UuidToBin'
'MySQL 8.0':
image: 'mysql:8.0'
connectionStringExtra: ''
unsupportedFeatures: 'Ed25519,StreamingResults,Tls11,ZeroDateTime'
'MariaDB 10.5':
image: 'mariadb:10.5'
connectionStringExtra: ''
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Sha256Password,Tls11,UuidToBin'
'MariaDB 10.6':
image: 'mariadb:10.6'
connectionStringExtra: ''
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Sha256Password,Tls11,UuidToBin'
'MariaDB 10.10':
image: 'mariadb:10.10'
connectionStringExtra: ''
unsupportedFeatures: 'CachingSha2Password,CancelSleepSuccessfully,Json,RoundDateTime,QueryAttributes,Sha256Password,Tls11,UuidToBin'
steps:
- template: '.ci/integration-tests-steps.yml'
parameters:
image: $(image)
connectionStringExtra: $(connectionStringExtra)
unsupportedFeatures: $(unsupportedFeatures)
DotNetCoreSdkVersion: $(DotNetCoreSdkVersion)