psqlodbc2 CI - Add regression batch, multi-result/catalog, and type-conversion support Implements three planned feature batches, raising psqlodbc2 regression coverage from 14 to ~36 passing tests with no regressions. next-regression-batch: - SQLColAttribute, SQLGetInfo, SQLNumParams, SQLNativeSql exports - Boolean column conversion ("t"/"f" -> "1"/"0" and correct integers) - ODBC escape processing ({fn}, {d}, {t}, {ts}, {oj}, {escape}) - libpq NOTICE capture surfaced via SQLGetDiagRec multi-result-and... #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| run-name: psqlodbc2 CI - ${{ github.event.head_commit.message }} | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-and-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| name: Linux (Ubuntu) | |
| - os: macos-latest | |
| name: macOS | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| services: | |
| postgres: | |
| image: ${{ matrix.os == 'ubuntu-latest' && 'postgres:17' || '' }} | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: contrib_regression | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Install dependencies (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| meson ninja-build \ | |
| libpq-dev unixodbc-dev libodbcinst2 | |
| - name: Install dependencies (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install meson ninja libpq unixodbc postgresql@17 | |
| brew services start postgresql@17 | |
| sleep 3 | |
| createdb contrib_regression || true | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Configure | |
| run: meson setup builddir | |
| env: | |
| PKG_CONFIG_PATH: ${{ matrix.os == 'macos-latest' && '/opt/homebrew/opt/libpq/lib/pkgconfig' || '' }} | |
| - name: Build | |
| run: meson compile -C builddir | |
| - name: Test (unit tests) | |
| run: meson test -C builddir | |
| env: | |
| PSQLODBC2_TEST_CONNSTR: "" | |
| - name: Test (with PostgreSQL) | |
| run: meson test -C builddir | |
| env: | |
| PSQLODBC2_TEST_CONNSTR: ${{ matrix.os == 'ubuntu-latest' && 'Server=localhost;Port=5432;Database=contrib_regression;UID=postgres;PWD=postgres' || 'Server=localhost;Port=5432;Database=contrib_regression' }} | |
| windows: | |
| name: Windows | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install meson, ninja, and pkgconf | |
| run: python -m pip install meson ninja pkgconf | |
| - name: Setup MSVC | |
| uses: TheMrMilchmann/setup-msvc-dev@v3 | |
| with: | |
| arch: x64 | |
| - name: Remove Strawberry Perl from PATH | |
| shell: powershell | |
| run: | | |
| # Strawberry Perl injects ccache and a broken pkg-config into PATH | |
| $cleanPath = ($env:PATH -split ';' | Where-Object { $_ -notlike '*Strawberry*' }) -join ';' | |
| echo "PATH=$cleanPath" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Install PostgreSQL | |
| shell: powershell | |
| run: | | |
| choco install postgresql17 --params "/Password:postgres /Port:5432" -y | |
| # Add PostgreSQL bin to PATH for DLL loading at runtime | |
| echo "C:\Program Files\PostgreSQL\17\bin" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| - name: Fix libpq.pc prefix | |
| shell: powershell | |
| run: | | |
| # The choco-installed PostgreSQL ships a libpq.pc with the build machine's | |
| # prefix path baked in. Rewrite it to point to the actual install location. | |
| $pgDir = "C:/Program Files/PostgreSQL/17" | |
| $pcDir = "$pgDir/lib/pkgconfig" | |
| if (Test-Path "$pcDir/libpq.pc") { | |
| @" | |
| prefix=$pgDir | |
| includedir=`${prefix}/include | |
| libdir=`${prefix}/lib | |
| Name: libpq | |
| Description: PostgreSQL libpq library | |
| Version: 17 | |
| Libs: -L`${libdir} -lpq | |
| Cflags: -I`${includedir} | |
| "@ | Set-Content "$pcDir/libpq.pc" | |
| } | |
| - name: Configure | |
| shell: powershell | |
| run: | | |
| # Create native file to use pkgconf-pypi (avoids broken pkg-config) | |
| @" | |
| [binaries] | |
| pkg-config = 'pkgconf-pypi' | |
| [built-in options] | |
| pkg_config_path = 'C:/Program Files/PostgreSQL/17/lib/pkgconfig' | |
| "@ | Set-Content native.ini | |
| meson setup builddir -Ddriver_manager=none --native-file=native.ini | |
| - name: Build | |
| run: meson compile -C builddir | |
| - name: Test (unit tests) | |
| run: meson test -C builddir | |
| env: | |
| PSQLODBC2_TEST_CONNSTR: "" | |
| - name: Test (with PostgreSQL) | |
| run: meson test -C builddir | |
| env: | |
| PSQLODBC2_TEST_CONNSTR: "Server=localhost;Port=5432;Database=postgres;UID=postgres;PWD=postgres" |