Skip to content

Commit 53d5b47

Browse files
committed
build and test MSI
1 parent 322e4fd commit 53d5b47

File tree

1 file changed

+86
-4
lines changed

1 file changed

+86
-4
lines changed

.github/workflows/windows-arm64.yml

Lines changed: 86 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- 'main'
77
- 'bb-*'
88
- '[0-9]+.[0-9]+'
9+
- '*wlad*'
910
pull_request:
1011

1112
jobs:
@@ -27,7 +28,7 @@ jobs:
2728

2829
- name: Install bison
2930
run: |
30-
choco install winflexbison3
31+
choco install winflexbison3 wixtoolset
3132
3233
- name: Build
3334
run: |
@@ -40,9 +41,90 @@ jobs:
4041
cd bld
4142
cmake .. -DWITH_SSL=bundled
4243
cmake --build . --config RelWithDebinfo --verbose -- -m
43-
cmake --build . --config RelWithDebInfo --target win_package_zip
44+
cmake --build . --config RelWithDebInfo --target MSI
4445
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
46128
run: |
47129
$env:PATH = "C:\Strawberry\perl\bin;$env:PATH;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64"
48130
#Calculate parallel as 4 * number of processors
@@ -52,7 +134,7 @@ jobs:
52134
--testcase-timeout=10 --suite=main,unit --skip-test=unit.my_tzinfo `
53135
--mysqld=--loose-innodb-flush-log-at-trx-commit=2
54136
55-
- name: Test sequential
137+
- name: Test MTR non-parallel
56138
# tests that can't run in parallel
57139
run: |
58140
$env:PATH = "C:\Strawberry\perl\bin;$env:PATH;C:\Program Files (x86)\Windows Kits\10\Debuggers\arm64"

0 commit comments

Comments
 (0)