Files
NexaPG/.github/workflows/pg-compat-matrix.yml
nessi 328f69ea5e
All checks were successful
Container CVE Scan (development) / Scan backend/frontend images for CVEs (push) Successful in 2m44s
PostgreSQL Compatibility Matrix / PG14 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG15 smoke (push) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG17 smoke (push) Successful in 7s
PostgreSQL Compatibility Matrix / PG18 smoke (push) Successful in 7s
Migration Safety / Alembic upgrade/downgrade safety (pull_request) Successful in 21s
PostgreSQL Compatibility Matrix / PG14 smoke (pull_request) Successful in 7s
PostgreSQL Compatibility Matrix / PG15 smoke (pull_request) Successful in 8s
PostgreSQL Compatibility Matrix / PG16 smoke (pull_request) Successful in 8s
PostgreSQL Compatibility Matrix / PG17 smoke (pull_request) Successful in 7s
PostgreSQL Compatibility Matrix / PG18 smoke (pull_request) Successful in 7s
Update GitHub Actions workflows for improved functionality
Removed the read-only flag from Docker volume mounts in the container CVE scan workflow to allow modifications. Added `max-parallel` and `fetch-depth` configurations to the PostgreSQL compatibility matrix workflow for better performance and efficiency.
2026-02-14 22:04:58 +01:00

73 lines
2.2 KiB
YAML

name: PostgreSQL Compatibility Matrix
on:
push:
branches: ["main", "master", "development"]
pull_request:
jobs:
pg-compat:
name: PG${{ matrix.pg_version }} smoke
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 3
matrix:
pg_version: ["14", "15", "16", "17", "18"]
services:
postgres:
image: postgres:${{ matrix.pg_version }}
env:
POSTGRES_DB: compatdb
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d compatdb"
--health-interval 5s
--health-timeout 5s
--health-retries 20
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install backend dependencies
run: pip install -r backend/requirements.txt
- name: Enable pg_stat_statements in service container
run: |
PG_CID="$(docker ps --filter "ancestor=postgres:${{ matrix.pg_version }}" --format "{{.ID}}" | head -n1)"
if [ -z "$PG_CID" ]; then
echo "Could not find postgres service container for version ${{ matrix.pg_version }}"
docker ps -a
exit 1
fi
echo "Using postgres container: $PG_CID"
docker exec "$PG_CID" psql -U postgres -d compatdb -c "ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';"
docker restart "$PG_CID"
for i in $(seq 1 40); do
if docker exec "$PG_CID" pg_isready -U postgres -d compatdb; then
break
fi
sleep 2
done
docker exec "$PG_CID" psql -U postgres -d compatdb -c "CREATE EXTENSION IF NOT EXISTS pg_stat_statements;"
- name: Run PostgreSQL compatibility smoke checks
env:
PG_DSN_CANDIDATES: postgresql://postgres:postgres@postgres:5432/compatdb?sslmode=disable,postgresql://postgres:postgres@127.0.0.1:5432/compatdb?sslmode=disable
run: python backend/scripts/pg_compat_smoke.py