Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test on multiple postgres versions #62

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ services:
- cargo
- pgrx
- test
- pg16
- pg${PG_VERSION:-16}
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: Test
name: tests
on:
pull_request:
push: { branches: [master] }

jobs:
test:
name: Run tests
strategy:
matrix:
postgres: [14, 15, 16, 17]
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build docker images
run: docker compose -f .ci/docker-compose.yaml build
run: PG_VERSION=${{ matrix.postgres }} docker compose -f .ci/docker-compose.yaml build

- name: Run tests
run: docker compose -f .ci/docker-compose.yaml run test_pg_jsonschema
run: PG_VERSION=${{ matrix.postgres }} docker compose -f .ci/docker-compose.yaml run test_pg_jsonschema
11 changes: 6 additions & 5 deletions dockerfiles/db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM postgres:16
ARG PG_VERSION=16
FROM postgres:${PG_VERSION}
RUN apt-get update

ENV build_deps ca-certificates \
git \
build-essential \
libpq-dev \
postgresql-server-dev-16 \
postgresql-server-dev-${PG_MAJOR} \
curl \
libreadline6-dev \
zlib1g-dev
Expand All @@ -29,15 +30,15 @@ RUN \
# PGX
RUN cargo install cargo-pgrx --version 0.12.4 --locked

RUN cargo pgrx init --pg16 $(which pg_config)
RUN cargo pgrx init --pg${PG_MAJOR} $(which pg_config)

USER root

COPY . .
RUN cargo pgrx install

RUN chown -R postgres:postgres /home/supa
RUN chown -R postgres:postgres /usr/share/postgresql/16/extension
RUN chown -R postgres:postgres /usr/lib/postgresql/16/lib
RUN chown -R postgres:postgres /usr/share/postgresql/${PG_MAJOR}/extension
RUN chown -R postgres:postgres /usr/lib/postgresql/${PG_MAJOR}/lib

USER postgres
Loading