From f7a496ca0733a9aba3e678cd426bf5d850e2f2ed Mon Sep 17 00:00:00 2001 From: divyakush2006 Date: Mon, 16 Nov 2026 19:24:03 +0530 Subject: [PATCH] ci: pin PostgreSQL client tools to the service version in API tests The backup-restore drill test uses whatever pg_dump and pg_restore are on PATH. The runner image's default client is now newer than the PostgreSQL 15 and 16 services, and the restore fails. Install the client matching each matrix version and point PG_BIN at it, the same way backup-drill.yml already does. The drill itself passes unchanged with matching tools. --- .github/workflows/ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c6950f..907eb53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,19 @@ jobs: run: npm run db:bundle -- --check - name: No known vulnerabilities (production and dev dependencies) run: npm audit --audit-level=high + - name: Client tools matching the server (PostgreSQL ${{ matrix.postgres }}) + # The backup-restore drill test dumps and restores with pg_dump and + # pg_restore. The runner image's default client can be newer than the + # service, and newer dumps may not restore into an older server, so pin + # the client to the server's major version (as backup-drill.yml does). + run: | + sudo install -d /usr/share/postgresql-common/pgdg + sudo curl -fsSL -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc + . /etc/os-release + echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list + sudo apt-get update + sudo apt-get install -y postgresql-client-${{ matrix.postgres }} + echo "PG_BIN=/usr/lib/postgresql/${{ matrix.postgres }}/bin" >> "$GITHUB_ENV" - run: npm test frontend: