4646 run : |
4747 Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
4848 Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -Scope CurrentUser -ForceBootstrap -ErrorAction Continue
49- Install-Module -Name PSFirebird -Force -AllowClobber -Scope CurrentUser -Repository PSGallery
49+ Install-Module -Name PSFirebird -MinimumVersion 1.2.2 - Force -AllowClobber -Scope CurrentUser -Repository PSGallery
5050
5151 - name : Create Firebird environment
5252 run : |
@@ -55,45 +55,20 @@ jobs:
5555 $fbEnv = New-FirebirdEnvironment -Version '${{ matrix.fb-semver }}' -Path $fbPath
5656 Write-Output $fbEnv
5757 Write-Output "FB_PATH=$fbPath" >> $env:GITHUB_ENV
58- $global:LASTEXITCODE = 0
58+ Write-Output "FB_CLIENT_LIB=$($fbEnv.GetClientLibraryPath())" >> $env:GITHUB_ENV
5959
6060 - name : Configure and start Firebird
6161 run : |
62+ # Initialize SYSDBA in security database via embedded connection (no server needed)
63+ $tempDb = Join-Path $env:FB_PATH 'temp_init.fdb'
64+ New-FirebirdDatabase -Database $tempDb -Environment $env:FB_PATH
65+ "CREATE OR ALTER USER SYSDBA PASSWORD 'masterkey';" | Invoke-FirebirdIsql -Database $tempDb -Environment $env:FB_PATH
66+ Remove-Item $tempDb -Force
6267 # Configure RemoteAuxPort for Firebird events support
6368 $confPath = Join-Path $env:FB_PATH 'firebird.conf'
6469 Write-FirebirdConfiguration -Path $confPath -Configuration @{ RemoteAuxPort = 3051 }
6570 # Start Firebird server
66- $instance = Start-FirebirdInstance -Environment $env:FB_PATH
67- Write-Output $instance
68- # Wait for the server to be ready
69- Write-Output "Waiting for Firebird to be ready..."
70- for ($i = 1; $i -le 30; $i++) {
71- try {
72- $tcp = [System.Net.Sockets.TcpClient]::new('localhost', 3050)
73- $tcp.Close()
74- Write-Output "Firebird is ready!"
75- break
76- } catch {
77- if ($i -eq 30) { Write-Error "Firebird failed to start"; exit 1 }
78- Write-Output "Waiting... ($i/30)"
79- Start-Sleep -Seconds 2
80- }
81- }
82- $global:LASTEXITCODE = 0
83-
84- - name : Find Firebird client library
85- run : |
86- if ($IsWindows) {
87- $clientLib = Join-Path $env:FB_PATH 'fbclient.dll'
88- } else {
89- foreach ($name in @('lib/libfbclient.so.2', 'lib/libfbclient.so')) {
90- $p = Join-Path $env:FB_PATH $name
91- if (Test-Path $p) { $clientLib = $p; break }
92- }
93- }
94- Write-Output "Found client library: $clientLib"
95- Write-Output "FB_CLIENT_LIB=$clientLib" >> $env:GITHUB_ENV
96- $global:LASTEXITCODE = 0
71+ Start-FirebirdInstance -Environment $env:FB_PATH | Write-Output
9772
9873 - name : Run tests
9974 run : hatch test -- --host=localhost --port=3050 "--client-lib=$env:FB_CLIENT_LIB" -v
10277
10378 - name : Stop Firebird instance
10479 if : always()
105- run : |
106- Get-FirebirdInstance | Stop-FirebirdInstance
107- $global:LASTEXITCODE = 0
80+ run : Get-FirebirdInstance | Stop-FirebirdInstance
10881
10982 build :
11083 needs : test
0 commit comments