-
Notifications
You must be signed in to change notification settings - Fork 11
71 lines (58 loc) · 2.07 KB
/
database_ud.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
60
61
62
63
64
65
66
67
68
69
70
71
name: Create Giswater Schema SAMPLE (UD)
on:
push:
branches: [dev-3.6]
pull_request:
branches: [dev-3.6]
jobs:
setup-and-test-db:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r test/requirements.txt
- name: Setup PostgreSQL and PostGIS for Linux/macOS/Windows
uses: nyurik/action-setup-postgis@v2.1
with:
database: giswater_test_db
- name: Install pgrouting & postgis_raster
env:
PGPASSWORD: postgres
run: |
sudo apt-get install postgresql-14-pgrouting
psql -h localhost -U postgres -d giswater_test_db -c 'CREATE EXTENSION pgrouting;'
psql -h localhost -U postgres -d giswater_test_db -c 'CREATE EXTENSION postgis_raster;'
- name: Install pgTAP from package
env:
PGPASSWORD: postgres
run: |
sudo apt-get install -y postgresql-14-pgtap
psql -h localhost -U postgres -d giswater_test_db -c 'CREATE EXTENSION pgtap;'
- name: Replace variables in SQL files
run: python test/replace_vars.py ud
- name: Create Sample Schema
env:
PGPASSWORD: postgres
run: python test/execute_sql_files.py ud
- name: Run SQL Tests with pgTAP and pg_prove (PL/SQL)
env:
PGPASSWORD: postgres
run: |
pg_prove -h localhost -U postgres -d giswater_test_db test/plsql/ud/*.sql
- name: Run SQL Tests with pgTAP and pg_prove (UPSERT)
env:
PGPASSWORD: postgres
run: |
pg_prove -h localhost -U postgres -d giswater_test_db test/upsert/ud/*.sql
- name: Run SQL Tests with pgTAP and pg_prove (STRUCTURE)
env:
PGPASSWORD: postgres
run: |
pg_prove -h localhost -U postgres -d giswater_test_db test/structure/ud/*.sql