This repository was archived by the owner on Feb 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (50 loc) · 1.53 KB
/
pg_test.yaml
File metadata and controls
53 lines (50 loc) · 1.53 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Postgres tests with pg-tap
on: [workflow_call]
env:
PGPASSWORD: postgres
PGUSER: postgres
PGDATABASE: connectivity_intake
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install asdf
uses: asdf-vm/actions/setup@v1
- name: Cache asdf Postgres
uses: actions/cache@v2
env:
cache-name: asdf-postgres-cache
with:
path: |
/home/runner/.asdf
key: ${{ runner.os }}-postgres-14.1-${{ env.cache-name }}
restore-keys: |
${{ runner.os }}-postgres-14.1-${{ env.cache-name }}
- name: Setup Postgres DB
run: |
sudo apt-get update
sudo apt-get install -yqq sqitch libdbd-pg-perl postgresql-client
asdf plugin-add postgres || true
asdf plugin-update --all
asdf install postgres 14.1
asdf reshim
pg_ctl start
createdb ${{ env.PGDATABASE }} || true
sqitch deploy
working-directory: ./db
- name: Install pg_prove
run: sudo cpan TAP::Parser::SourceHandler::pgTAP
env:
SHELL: /bin/bash
- name: Install pgtap
run: |
git clone https://github.com/theory/pgtap.git
cd pgtap
git checkout v1.2.0
git branch
make
make install
psql -c 'CREATE EXTENSION pgtap;' || true
- name: Run Tests
run: pg_prove --username ${{ env.PGUSER }} --dbname ${{ env.PGDATABASE }} db/test/*/*_test.sql