From 740930ef147c0e08d5e1b9a69aa3da783693e41c Mon Sep 17 00:00:00 2001 From: "Dr. Patrick Urbanke" Date: Tue, 20 May 2025 20:33:26 +0200 Subject: [PATCH] Added a postgres container --- .github/workflows/linux-postgres-cxx20.yaml | 39 +++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/linux-postgres-cxx20.yaml diff --git a/.github/workflows/linux-postgres-cxx20.yaml b/.github/workflows/linux-postgres-cxx20.yaml new file mode 100644 index 0000000..f8d1397 --- /dev/null +++ b/.github/workflows/linux-postgres-cxx20.yaml @@ -0,0 +1,39 @@ +name: linux-postgres-cxx20 + +on: [ pull_request, workflow_dispatch ] + +jobs: + container-job: + runs-on: ubuntu-24.04 + container: node:20-bookworm-slim + + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - name: Check out repository code + uses: actions/checkout@v4 + + # Performs a clean installation of all dependencies in the `package.json` file + # For more information, see https://docs.npmjs.com/cli/ci.html + - name: Install dependencies + run: npm ci + + - name: Connect to PostgreSQL + # Runs a script that creates a PostgreSQL table, populates + # the table with data, and then retrieves the data. + run: node client.js + # Environment variables used by the `client.js` script to create a new PostgreSQL table. + env: + # The hostname used to communicate with the PostgreSQL service container + POSTGRES_HOST: postgres + # The default PostgreSQL port + POSTGRES_PORT: 5432