-
Notifications
You must be signed in to change notification settings - Fork 0
28 lines (27 loc) · 1 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
name: CI
on: [push, pull_request]
jobs:
tests-database:
runs-on: ubuntu-20.04
container:
image: artifacthub/db-tests
services:
postgres:
image: artifacthub/postgres
env:
POSTGRES_USER: tests
POSTGRES_PASSWORD: tests
POSTGRES_DB: tests
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Apply database migrations
run: TERN_CONF=../.github/workflows/tern.conf PGPORT=${{ job.services.postgres.ports[5432] }} ./migrate.sh
- name: Install pgtap database extension
run: PGPASSWORD=tests psql -h postgres -p ${{ job.services.postgres.ports[5432] }} -U tests tests -c 'create extension pgtap;'
- name: Run database tests
working-directory: ./tests
run: PGPASSWORD=tests pg_prove --host postgres --dbname tests --username tests --verbose *.sql