Skip to content

Commit

Permalink
Adds matrix pg_version for ci test command
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-w-ross committed Jul 29, 2023
1 parent 9eb091f commit 31ead3d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
2 changes: 2 additions & 0 deletions .ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ services:
build:
context: ..
dockerfile: ./dockerfiles/db/Dockerfile
args:
PG_VERSION: ${PG_VERSION:-15}
command:
- ./bin/installcheck
16 changes: 9 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ on:
jobs:
test:
name: Run tests
strategy:
matrix:
postgres: [14, 15]
runs-on: ubuntu-latest

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

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

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

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

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

USER root

Expand Down

0 comments on commit 31ead3d

Please sign in to comment.