forked from codeforpdx/recordexpungPDX
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (49 loc) · 1.52 KB
/
main.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
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
54
55
name: recordexpungPDX tests
on: [pull_request]
jobs:
frontend:
runs-on: ubuntu-latest
container:
image: node:alpine
env:
CI: true
steps:
- uses: actions/checkout@v2
- name: run frontend tests
run: cd src/frontend && npm i && npm test
backend:
runs-on: ubuntu-latest
container:
image: recordsponge/expungeservice:dev
env:
PGUSER: postgres
PGDATABASE: record_expunge_test
PGHOST: postgres
PGPORT: 5432
PGPASSWORD: testing
services:
postgres:
image: postgres:10-alpine
env:
POSTGRES_PASSWORD: testing
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: copy to pipenv project dir
run: cp -R src/backend/* /src/backend && ls -l /src/backend
- name: add pg client
run: apk add postgresql-client
- name: create database
run: createdb ${PGDATABASE}
- name: create tables
run: psql -v ON_ERROR_STOP=1 -f config/postgres/initdb/scripts/create-tables.sql
- name: create functions
run: psql -v ON_ERROR_STOP=1 -f config/postgres/initdb/scripts/create-functions.sql
- name: create credentials
run: psql -v ON_ERROR_STOP=1 -f config/postgres/initdb/scripts/initial_credentials.dev.sql
- name: run backend tests
run: cd /src/backend && pipenv run mypy && pipenv run pytest