-
-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (58 loc) · 1.76 KB
/
test.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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-postgresql:
name: Test pg-restore with PostgreSQL version
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
postgresql_version: [12, 14, 15]
services:
postgres:
image: postgres:${{ matrix.postgresql_version }}
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
POSTGRES_DB: testdb
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run database backup restore test.
uses: ./
with:
database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
postgresql_version: ${{ matrix.postgresql_version }}
backup_file: "backups/backup.sql"
test:
runs-on: ubuntu-latest
name: Test pg-restore
services:
postgres:
image: postgres:16.6
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_user_password
POSTGRES_DB: testdb
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run database backup restore test.
uses: ./
with:
database_url: "postgres://test_user:test_user_password@localhost:5432/testdb"
backup_file: "backups/backup.sql"