Skip to content

Commit

Permalink
feat(workflows/test): Add matrix for different tests
Browse files Browse the repository at this point in the history
Add different os and os versions for the base image and Postgres version
to check compatibility in different environments with different Postgres
versions.
  • Loading branch information
tparsa committed Oct 1, 2023
1 parent e4fa19c commit 0d71de8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ on:

jobs:
test:
strategy:
matrix:
os: [ubuntu]
os_version: [20.04, 22.04]
postgres_version: [9.5, 10, 11, 12, 13]

runs-on: ubuntu-20.04

steps:
Expand All @@ -21,6 +27,10 @@ jobs:

- name: Start containers
run: docker-compose -f "deployment/docker-compose.yml" up -d --build
env:
OS: ${{os}}
OS_VERSION: ${{os_version}}
POSTGRES_VERSION: ${{postgres_version}}

- name: Sleep so containers are ready
run: sleep 15
Expand Down
8 changes: 6 additions & 2 deletions deployment/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM ubuntu:22.04
ARG OS=ubuntu
ARG OS_VERSION=22.04

FROM ${OS}:${OS_VERSION}

ENV container docker
ENV LC_ALL C
Expand All @@ -15,7 +18,8 @@ RUN apt-get update && apt-get install -y \
lsb-core
RUN echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update && apt-get install -y postgresql-12
ARG POSTGRES_VERSION=13
RUN apt-get update && apt-get install -y postgresql-${POSTGRES_VERSION}

RUN pip3 install pyyaml

Expand Down
8 changes: 8 additions & 0 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
OS: ${OS}
OS_VERSION: ${OS_VERSION}
POSTGRES_VERSION: ${POSTGRES_VERSION}
hostname: master
restart: always
command: 'bash -c "/init.sh && sleep 3600"'
Expand All @@ -20,6 +24,10 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
OS: ${OS}
OS_VERSION: ${OS_VERSION}
POSTGRES_VERSION: ${POSTGRES_VERSION}
hostname: replica
restart: always
command: 'bash -c "/init.sh && exec /lib/systemd/systemd" && sleep 3600'
Expand Down

0 comments on commit 0d71de8

Please sign in to comment.