Skip to content

PostgreSQL for github actions #23

PostgreSQL for github actions

PostgreSQL for github actions #23

Workflow file for this run

name: ci
on:
push:
branches: [main, master]
pull_request:
types: [opened, reopened, synchronize]
jobs:
vm-job:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: securepassword
POSTGRES_DB: blog
PGPORT: 5431
ports:
- 5431:5431
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4.1.7
- id: setup
uses: ./.github/actions/install-deps
- name: Create multiple databases
shell: bash
env:
POSTGRES_USER: user
POSTGRES_HOST: localhost
# POSTGRES_PASSWORD: securepassword
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_MULTIPLE_DATABASES: content_blog
PGPORT: 5431
run: |
set -v
chmod +x ./pg-bootstrap.sh
./pg-bootstrap.sh
- name: Run tests
run: |
set -v
make test