-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (55 loc) · 1.52 KB
/
databaseConsistency.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
56
57
58
59
name: Check database consistency
on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- name: Use Node.js 20.x
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
uses: actions/setup-node@v2
with:
node-version: 20.x
- name: Install pg-diff
run: |
npm install -g pg-diff-cli
- name: Heroku login credentials
run: |
cat > ~/.netrc <<EOF
machine api.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
machine git.heroku.com
login $HEROKU_EMAIL
password $HEROKU_API_KEY
EOF
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_EMAIL: ${{ secrets.HEROKU_EMAIL }}
- name: Run compare script
run: |
cd server
cd src
cd dbUtils
chmod +x ./compareSchemata.sh
sed -i -e 's/\r$//' ./compareSchemata.sh
./compareSchemata.sh