forked from shuttle-hq/synth
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.65 KB
/
synth-postgres.yml
File metadata and controls
52 lines (48 loc) · 1.65 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
name: synth-postgres
on:
push:
branches: [ master ]
paths: [ '**/*.rs' ]
pull_request:
branches: [ master ]
paths: [ '**/*.rs' ]
workflow_dispatch:
env:
RUSTFLAGS: "-D warnings"
jobs:
e2e_tests_postgres:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
-p 5432:5432
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
- run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends postgresql-client jq
- run: |
psql -f synth/testing_harness/postgres/0_hospital_schema.sql postgres://postgres:postgres@localhost:5432/postgres
psql -f synth/testing_harness/postgres/1_hospital_data.sql postgres://postgres:postgres@localhost:5432/postgres
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- run: cargo +nightly install --debug --path=synth
- run: |
echo "Running generate test"
cd synth/testing_harness/postgres
synth generate --size 10 hospital_master > hospital_data_generated.json
diff hospital_data_generated.json hospital_data_generated_master.json || exit 1
- run: |
echo "Testing import"
cd synth/testing_harness/postgres
synth init || true
synth import --from postgres://postgres:postgres@localhost:5432/postgres hospital_import
diff <(jq --sort-keys . hospital_import/*) <(jq --sort-keys . hospital_master/*)