Skip to content

Add GitHub action to run setup.sql against database. #8

Add GitHub action to run setup.sql against database.

Add GitHub action to run setup.sql against database. #8

Workflow file for this run

name: PostgreSQL
on:
workflow_dispatch:
pull_request:
branches:
- "*"
jobs:
postgresql:
name: Test PostgreSQL
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_DB: cost_effectiveness
POSTGRES_PASSWORD: security_is_important
POSTGRES_USER: cost_effectiveness
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout
uses: actions/checkout@v6.0.1
- name: Update packages
run: sudo apt-get update
- name: Install PostgreSQL client
run: sudo apt-get install --yes --no-install-recommends postgresql-client
- name: Run database creation script
run: psql --file setup.sql
env:
PGDATABASE: cost_effectiveness
PGHOST: postgres
PGPASSWORD: security_is_important
PGUSER: cost_effectiveness