Skip to content

Merge pull request #458 from PingoLee/fix/452-multipath-delete-params #478

Merge pull request #458 from PingoLee/fix/452-multipath-delete-params

Merge pull request #458 from PingoLee/fix/452-multipath-delete-params #478

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
# Cancel in-progress runs for the same branch when a new push arrives.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Julia ${{ matrix.julia-version }} — ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Test on minimum supported version and latest stable.
# Integration tests (test/integration/) require a live PostgreSQL database
# and are NOT part of this CI job — they run separately in a dev environment.
julia-version: ['1.12', '1']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
# julia-runtest runs test/runtests.jl via Pkg.test().
# Unit tests have no external database dependency. The test target pulls in
# LibPQ + SQLite (Project.toml `[extras]`/`[targets]`) so the weakdep driver
# extensions load and the SQLite-backed unit tests run.
- uses: julia-actions/julia-runtest@v1
# Prove the loading contract: `using PormG` works with NO SQL driver present, and a
# backend operation raises the friendly "load the driver" error instead of a missing
# method / hard reference. This is the guarantee that LibPQ/SQLite are truly weakdeps.
load-without-drivers:
name: Load without drivers — Julia ${{ matrix.julia-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
julia-version: ['1.12', '1']
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- name: using PormG with no driver loaded
run: |
julia --project=. -e '
using PormG
# No `using LibPQ` / `using SQLite`: the backend generics must fall back.
# Assert inside a FUNCTION (hard scope). In a `julia -e` script, assigning a
# flag from inside a `try`/`catch` hits soft scope and silently creates a new
# local, so an outer `@assert flag` would fail even when the error was raised.
function expect_friendly(pool, needle)
try
PormG.backend_connect(pool)
catch e
msg = sprint(showerror, e)
@assert occursin(needle, msg) "unexpected error for $(typeof(pool)): $msg"
return
end
error("backend_connect should have thrown for $(typeof(pool)) when its driver is not loaded")
end
# Both backends must fail friendly, symmetrically.
expect_friendly(PormG.ConnectionPool.PostgresConnectionPool("dummy"; pool_size=1), "requires LibPQ")
expect_friendly(PormG.ConnectionPool.SQLiteConnectionPool("dummy.sqlite"; pool_size=1), "requires SQLite")
println("OK: PormG loads without drivers and both backends fail friendly on use")
'