diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index a9a0664..efa5f20 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -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: @@ -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 diff --git a/deployment/Dockerfile b/deployment/Dockerfile index 41a37d2..394a8a6 100644 --- a/deployment/Dockerfile +++ b/deployment/Dockerfile @@ -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 @@ -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 diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index a0abe52..ee00c5d 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -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"' @@ -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'