|
6 | 6 | - 'main' |
7 | 7 | - 'bb-*' |
8 | 8 | - '[0-9]+.[0-9]+' |
| 9 | + - '*wlad*' |
9 | 10 | pull_request: |
10 | 11 |
|
11 | 12 | jobs: |
|
27 | 28 |
|
28 | 29 | - name: Install bison |
29 | 30 | run: | |
30 | | - choco install winflexbison3 |
| 31 | + choco install winflexbison3 wixtoolset |
31 | 32 |
|
32 | 33 | - name: Build |
33 | 34 | run: | |
|
40 | 41 | cd bld |
41 | 42 | cmake .. -DWITH_SSL=bundled |
42 | 43 | cmake --build . --config RelWithDebinfo --verbose -- -m |
43 | | - cmake --build . --config RelWithDebInfo --target win_package_zip |
| 44 | + cmake --build . --config RelWithDebInfo --target MSI |
44 | 45 |
|
45 | | - - name: Test |
| 46 | + - name: Test MSI |
| 47 | + shell: pwsh |
| 48 | + run: | |
| 49 | + # Find the MSI file |
| 50 | + $msi = Get-ChildItem -Recurse -Filter *.msi -Path bld\win\packaging | Select-Object -First 1 |
| 51 | + if (-not $msi) { |
| 52 | + Write-Error "No MSI file found in build directory" |
| 53 | + exit 1 |
| 54 | + } |
| 55 | + # Define install parameters |
| 56 | + $msiPath = $msi.FullName |
| 57 | + $installDir = "C:\mariadb" |
| 58 | + $serviceName = "MariaDB" |
| 59 | + $rootPassword = "b1ctUj5rcRSADLC" |
| 60 | + $logPath = "$env:RUNNER_TEMP\msi-install.log" |
| 61 | + # Install MSI |
| 62 | + $installArgs = "/i `"$msiPath`" INSTALLDIR=`"$installDir`" SERVICE=$serviceName PASSWORD=$rootPassword /qn /norestart /l*v `"$logPath`"" |
| 63 | + echo "Installing MSI: $msiPath , args=$installArgs " |
| 64 | + $process = Start-Process msiexec.exe -Wait -NoNewWindow -ArgumentList $installArgs |
| 65 | + if ($process.ExitCode -ne 0) { |
| 66 | + Write-Error "MSI installation failed with exit code $($process.ExitCode)" |
| 67 | + echo "::group::MSI Install Log" |
| 68 | + Get-Content $logPath |
| 69 | + echo "::endgroup::" |
| 70 | + exit 1 |
| 71 | + } |
| 72 | + # Wait for Windows service to reach "Running" |
| 73 | + $maxAttempts = 30 |
| 74 | + $attempt = 0 |
| 75 | + while ($attempt -lt $maxAttempts) { |
| 76 | + $status = (Get-Service -Name $serviceName).Status |
| 77 | + if ($status -eq "Running") { |
| 78 | + echo "Service $serviceName is running" |
| 79 | + break |
| 80 | + } |
| 81 | + Start-Sleep -Seconds 1 |
| 82 | + $attempt++ |
| 83 | + } |
| 84 | + if ($status -ne "Running") { |
| 85 | + Write-Error "Service $serviceName did not start within timeout" |
| 86 | + exit 1 |
| 87 | + } |
| 88 | + $port = 3306 |
| 89 | + $maxAttempts = 30 |
| 90 | + $attempt = 0 |
| 91 | + $ready = $false |
| 92 | + while ($attempt -lt $maxAttempts) { |
| 93 | + $connections = Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue |
| 94 | + if ($connections) { |
| 95 | + echo "Port $port is now listening" |
| 96 | + $ready = $true |
| 97 | + break |
| 98 | + } |
| 99 | + Start-Sleep -Seconds 1 |
| 100 | + $attempt++ |
| 101 | + } |
| 102 | + if (-not $ready) { |
| 103 | + Write-Error "Port $port did not start listening within timeout" |
| 104 | + exit 1 |
| 105 | + } |
| 106 | + $mysqlExe = Join-Path $installDir "bin\mysql.exe" |
| 107 | + if (-Not (Test-Path $mysqlExe)) { |
| 108 | + Write-Error "mysql.exe not found at $mysqlExe" |
| 109 | + exit 1 |
| 110 | + } |
| 111 | + & $mysqlExe -uroot "--password=$rootPassword" -e "select 1" |
| 112 | + if ($LASTEXITCODE -ne 0) { |
| 113 | + Write-Error "Smoke test failed" |
| 114 | + exit 1 |
| 115 | + } |
| 116 | + # Get product code for uninstall |
| 117 | + $product = Get-WmiObject Win32_Product | Where-Object { $_.InstallLocation -eq $installDir } | Select-Object -First 1 |
| 118 | + if (-not $product) { |
| 119 | + Write-Error "Could not determine MSI product for uninstall" |
| 120 | + exit 1 |
| 121 | + } |
| 122 | + $productCode = $product.IdentifyingNumber |
| 123 | + echo "Uninstalling product code: $productCode" |
| 124 | + $uninstallArgs = "/x $productCode /qn /norestart" |
| 125 | + Start-Process msiexec.exe -Wait -NoNewWindow -ArgumentList $uninstallArgs |
| 126 | +
|
| 127 | + - name: Test MTR |
46 | 128 | run: | |
47 | 129 | $env:PATH = "C:\Strawberry\perl\bin;$env:PATH;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64" |
48 | 130 | #Calculate parallel as 4 * number of processors |
|
52 | 134 | --testcase-timeout=10 --suite=main,unit --skip-test=unit.my_tzinfo ` |
53 | 135 | --mysqld=--loose-innodb-flush-log-at-trx-commit=2 |
54 | 136 |
|
55 | | - - name: Test sequential |
| 137 | + - name: Test MTR non-parallel |
56 | 138 | # tests that can't run in parallel |
57 | 139 | run: | |
58 | 140 | $env:PATH = "C:\Strawberry\perl\bin;$env:PATH;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64" |
|
0 commit comments