-
Notifications
You must be signed in to change notification settings - Fork 2
52 lines (45 loc) · 1.18 KB
/
Copy pathtest.yml
File metadata and controls
52 lines (45 loc) · 1.18 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: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
pg_version: [14, 15, 16, 17, 18]
services:
postgres:
image: postgres:${{ matrix.pg_version }}
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: pg_column_tetris_test
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
PGHOST: localhost
PGPORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: pg_column_tetris_test
steps:
- uses: actions/checkout@v4
- name: Install extension
run: |
# Strip the \echo...\quit guard so we can load the SQL directly
sed '/^\\echo.*\\quit/d' pg_column_tetris--0.1.0.sql | psql -v ON_ERROR_STOP=1
- name: Run tests
run: |
for f in test/sql/*.sql; do
echo "=== Running $f ==="
psql -v ON_ERROR_STOP=1 -f "$f"
echo "=== $f passed ==="
done