forked from mysql-net/MySqlConnector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
161 lines (155 loc) · 6.05 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
variables:
DotNetCoreSdkVersion: '3.0.100'
NUGET_PACKAGES: '$(Pipeline.Workspace)/.nuget/packages'
jobs:
- job: linux_build
displayName: 'Linux Build'
pool:
vmimage: 'ubuntu-latest'
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 SideBySide (net472)'
inputs:
command: 'publish'
arguments: '-c Release -f net472 tests/SideBySide/SideBySide.csproj'
publishWebProjects: false
zipAfterPublish: false
- task: PublishPipelineArtifact@0
inputs:
artifactName: 'SideBySide-net472-$(Agent.OS)'
targetPath: 'tests/SideBySide/bin/Release/net472/publish'
- task: DotNetCoreCLI@2
displayName: 'Create NuGet packages'
inputs:
command: 'custom'
projects: 'src/**/*.csproj'
custom: 'pack'
arguments: '-c Release --version-suffix build-$(Build.BuildNumber) -o $(Build.ArtifactStagingDirectory)'
- task: DotNetCoreCLI@2
displayName: 'Publish packages'
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
command: 'push'
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
nuGetFeedType: 'internal'
publishVstsFeed: 'Builds'
- job: windows_baseline
displayName: 'Baseline'
pool:
vmimage: 'windows-latest'
steps:
- script: |
mkdir C:\mysql
CD /D C:\mysql
curl -fsS --retry 3 --retry-connrefused -o mysql.msi https://cdn.mysql.com/archives/mysql-installer/mysql-installer-community-8.0.15.0.msi
msiexec /q /log install.txt /i mysql.msi datadir=C:\mysql installdir=C:\mysql
call "C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstallerConsole.exe" community install server;8.0.15;x64:*:port=3306;rootpasswd=test;servicename=MySQL -silent
netsh advfirewall firewall add rule name="Allow mysql" dir=in action=allow edge=yes remoteip=any protocol=TCP localport=3306
displayName: Install MySQL Server
- script: |
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest -e "SET GLOBAL local_infile=1; SET GLOBAL log_bin_trust_function_creators=1;"
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest < $(Build.Repository.LocalPath)\.ci\server\init.sql
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest < $(Build.Repository.LocalPath)\.ci\server\init_sha256.sql
"C:\Program Files\MySQL\MySQL Server 8.0\bin\mysql" -uroot -ptest < $(Build.Repository.LocalPath)\.ci\server\init_caching_sha2.sql
displayName: Configure MySQL Server
- task: CopyFiles@2
displayName: 'Copy config.json'
inputs:
sourceFolder: '.ci/config'
contents: 'config.json'
targetFolder: 'tests/SideBySide'
- task: DotNetCoreInstaller@0
displayName: 'Install .NET Core'
inputs:
version: $(DotNetCoreSdkVersion)
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
arguments: 'tests\MySqlConnector.Tests\MySqlConnector.Tests.csproj /p:Configuration=Baseline'
verbosityRestore: 'minimal'
- task: DotNetCoreCLI@2
displayName: 'Unit tests'
inputs:
command: 'test'
arguments: 'tests\MySqlConnector.Tests\MySqlConnector.Tests.csproj -c Baseline'
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
arguments: 'tests\SideBySide\SideBySide.csproj /p:Configuration=Baseline'
verbosityRestore: 'minimal'
- task: DotNetCoreCLI@2
displayName: 'Baseline tests'
inputs:
command: 'test'
arguments: 'tests\SideBySide\SideBySide.csproj -c Baseline --logger'
env:
DATA__UNSUPPORTEDFEATURES: 'Ed25519,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: 'Baseline Tests'
failTaskOnFailedTests: true
- job: linux_unit_tests
dependsOn: linux_build
displayName: 'Linux Unit Tests'
pool:
vmimage: 'ubuntu-latest'
steps:
- template: '.ci/mysqlconnector-tests-steps.yml'
- job: windows_unit_tests
dependsOn: windows_build
displayName: 'Windows Unit Tests'
pool:
vmimage: 'windows-latest'
steps:
- template: '.ci/mysqlconnector-tests-steps.yml'
- job: linux_integration_tests
dependsOn: linux_build
displayName: 'Linux Tests'
pool:
vmimage: 'ubuntu-latest'
strategy:
matrix:
'MySQL 5.6':
image: 'mysql:5.6'
unsupportedFeatures: 'Ed25519,Json,Sha256Password,LargePackets,CachingSha2Password,SessionTrack,Tls13,UuidToBin'
'MySQL 5.7':
image: 'mysql:5.7'
unsupportedFeatures: 'Ed25519,CachingSha2Password,Tls13,UuidToBin'
'MySQL 8.0':
image: 'mysql:8.0'
unsupportedFeatures: 'Ed25519,Tls13'
'Percona 5.7':
image: 'percona:5.7.22'
unsupportedFeatures: 'CachingSha2Password,Ed25519,Tls13,UuidToBin'
'MariaDB 10.2':
image: 'mariadb:10.2'
unsupportedFeatures: 'Ed25519,Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin'
'MariaDB 10.3':
image: 'mariadb:10.3'
unsupportedFeatures: 'Ed25519,Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin'
'MariaDB 10.4':
image: 'mariadb:10.4'
unsupportedFeatures: 'Json,Sha256Password,CachingSha2Password,RoundDateTime,UuidToBin'
steps:
- template: '.ci/integration-tests-steps.yml'
parameters:
image: $(image)
unsupportedFeatures: $(unsupportedFeatures)
DotNetCoreSdkVersion: $(DotNetCoreSdkVersion)