Added a postgres container

This commit is contained in:
Dr. Patrick Urbanke
2025-05-20 20:33:26 +02:00
parent bf8a20b51d
commit 740930ef14

View File

@@ -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