Skip to content

Bump github.com/jackc/pgx/v5 from 5.9.1 to 5.9.2 #21

Bump github.com/jackc/pgx/v5 from 5.9.1 to 5.9.2

Bump github.com/jackc/pgx/v5 from 5.9.1 to 5.9.2 #21

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Go Tests (PG ${{ matrix.postgres }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
postgres: ["16", "17", "18"]
services:
postgres:
image: postgres:${{ matrix.postgres }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "^1.26"
- name: Lint
uses: golangci/golangci-lint-action@v9
continue-on-error: true
with:
version: latest
args: --timeout=5m
- name: Unit tests
run: go test ./...
- name: E2E tests
env:
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
run: go test ./e2e -v -count=1
- name: Run examples
run: |
set -e
for dir in examples/composite_unique \
examples/decimal \
examples/fk_actions \
examples/ignore_field \
examples/index_partial \
examples/keyset_pagination \
examples/soft_delete \
examples/tx \
examples/uuid; do
echo "=== Running $dir ==="
go run "./$dir"
done
echo "=== Running examples/main.go ==="
go run ./examples
echo "=== Running examples/sql_migrations ==="
(cd examples/sql_migrations && go run .)
echo "=== Running examples/blog (timeout 5s) ==="
timeout 5 go run ./examples/blog || [ $? -eq 124 ] && echo "blog: OK (timed out as expected)"
echo "=== Running examples/observability (timeout 5s) ==="
timeout 5 go run ./examples/observability || [ $? -eq 124 ] && echo "observability: OK (timed out as expected)"
- name: Test coverage
env:
PGHOST: 127.0.0.1
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
run: |
go test -coverpkg=./... ./... -coverprofile=coverage.out -covermode=atomic
coverage=$(go tool cover -func=coverage.out | awk '/total:/ {print $3}' | sed 's/%//')
echo "Coverage: ${coverage}%"
threshold=80
awk -v c=$coverage -v t=$threshold 'BEGIN { if (c+0 < t) { printf("Coverage %.1f%% is below threshold %d%%\n", c, t); exit 1 } else { printf("Coverage OK: %.1f%% (threshold %d%%)\n", c, t); exit 0 } }'