@@ -18,18 +18,18 @@ jobs:
1818 - windows-latest
1919 - macos-latest
2020 config :
21- - qt_version : " 6.4.2 "
21+ - qt_version : " 6.5.3 "
2222 include :
2323 # Two Linux builds: one against libmysqlclient (MySQL 8+) and one
2424 # against libmariadb (MariaDB Connector/C) to catch type-mismatch
2525 # errors like the my_bool*/bool* incompatibility.
2626 - os : ubuntu-latest
2727 config :
28- qt_version : " 6.4.2 "
28+ qt_version : " 6.5.3 "
2929 mysql_lib : libmysqlclient-dev
3030 - os : ubuntu-latest
3131 config :
32- qt_version : " 6.4.2 "
32+ qt_version : " 6.11.0 "
3333 mysql_lib : libmariadb-dev
3434
3535 steps :
@@ -49,15 +49,62 @@ jobs:
4949 fi
5050 sudo apt install -y ${{ matrix.mysql_lib }}
5151
52+ # ── PostgreSQL ────────────────────────────────────────────────────
53+ sudo systemctl start postgresql.service
54+ # Create a superuser role matching the runner OS user so that
55+ # postgresql:/// (peer-auth, db == username) works without a password.
56+ sudo -u postgres createuser --superuser "$USER"
57+ createdb # creates database named after $USER
58+ echo "ASQL_PG_TEST_DB=postgresql:///" >> "$GITHUB_ENV"
59+
60+ # ── MySQL / MariaDB ───────────────────────────────────────────────
61+ # GitHub-hosted Ubuntu runners ship MySQL with root/root credentials.
62+ sudo systemctl start mysql.service
63+ mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS asql_test;"
64+ mysql -u root -proot -e \
65+ "CREATE USER IF NOT EXISTS 'asql'@'localhost' IDENTIFIED BY 'asql';"
66+ mysql -u root -proot -e \
67+ "GRANT ALL PRIVILEGES ON asql_test.* TO 'asql'@'localhost'; FLUSH PRIVILEGES;"
68+ echo "ASQL_MYSQL_TEST_DB=mysql://asql:asql@localhost/asql_test" >> "$GITHUB_ENV"
69+
5270 - name : Install dependencies on macOS
5371 if : runner.os == 'macOS'
5472 run : |
5573 brew install postgresql@16
74+ brew services start postgresql@16
75+ # Wait until the server accepts connections
76+ until pg_isready --host=localhost --port=5432; do sleep 1; done
77+ # Ensure a database exists for the runner user (required for postgresql:///)
78+ createdb || true
5679
57- - name : Install PostgreSQL 16 with Chocolatey
80+ - name : Set up PostgreSQL on Windows
5881 if : runner.os == 'Windows'
82+ shell : pwsh
5983 run : |
60- choco install postgresql --version=16.0 -y
84+ # PostgreSQL is pre-installed on windows-latest but stopped/disabled.
85+ # Find whichever version's service is present (14, 15, 16, ...).
86+ $pgSvc = Get-Service -Name "postgresql-x64-*" -ErrorAction SilentlyContinue |
87+ Select-Object -First 1
88+ if (-not $pgSvc) {
89+ Write-Error "No postgresql-x64-* service found on this runner."
90+ exit 1
91+ }
92+ Write-Host "Found service: $($pgSvc.Name)"
93+ Set-Service -Name $pgSvc.Name -StartupType Automatic
94+ Start-Service -Name $pgSvc.Name
95+ # Locate pg_isready / createdb via the PGBIN env var set by the image
96+ $pgBin = [System.Environment]::GetEnvironmentVariable('PGBIN')
97+ if (-not $pgBin) {
98+ # Fall back: find bin/ next to the service executable
99+ $pgBin = Split-Path (Get-WmiObject Win32_Service -Filter "Name='$($pgSvc.Name)'").PathName
100+ }
101+ & "$pgBin\pg_isready.exe" --host=localhost --port=5432 --timeout=30
102+ $env:PGPASSWORD = 'root'
103+ & "$pgBin\createdb.exe" -U postgres asql_test
104+ $pgDir = Split-Path $pgBin # C:\Program Files\PostgreSQL\14
105+ "ASQL_PG_TEST_DB=postgresql://postgres:root@localhost/asql_test" | `
106+ Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
107+ "PGDIR=$pgDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
61108
62109 - name : Install Qt with options and default aqtversion
63110 uses : jurplel/install-qt-action@v4
@@ -74,13 +121,13 @@ jobs:
74121 uses : ilammy/msvc-dev-cmd@v1
75122
76123 - name : Checkout sources
77- uses : actions/checkout@v4
124+ uses : actions/checkout@v6
78125
79126 - name : Configure project (Shared Link)
80127 run : >
81128 cmake -S . -B ./build-shared -G Ninja
82129 -DCMAKE_BUILD_TYPE=Debug
83- -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;C:\Program Files\PostgreSQL\16 "
130+ -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;${{ env.PGDIR }} "
84131 -DENABLE_MAINTAINER_CFLAGS=${{ matrix.build_type == 'Debug' }}
85132 -DBUILD_SHARED_LIBS=ON
86133 -DASQL_DRIVER_MYSQL=${{ runner.os == 'Linux' }}
@@ -104,7 +151,7 @@ jobs:
104151 run : >
105152 cmake -S . -B ./build-static -G Ninja
106153 -DCMAKE_BUILD_TYPE=Debug
107- -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;C:\Program Files\PostgreSQL\16 "
154+ -DCMAKE_PREFIX_PATH="/opt/homebrew/opt/postgresql@16;${{ env.PGDIR }} "
108155 -DBUILD_SHARED_LIBS=OFF
109156 -DASQL_DRIVER_MYSQL=${{ runner.os == 'Linux' }}
110157 -DASQL_DRIVER_ODBC=${{ runner.os == 'Linux' }}
0 commit comments