-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.61 KB
/
ci.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
name: CI
on: push
jobs:
test:
name: Run tests with PostgreSQL ${{ matrix.postgres-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
postgres-version: ['12', '13', '14', '15']
services:
postgres:
image: postgres:${{ matrix.postgres-version }}
env:
POSTGRES_PASSWORD: postgres
options:
--health-cmd pg_isready
--health-interval 10s
--health-retries 5
--health-timeout 5s
ports:
- 5432:5432
env:
PGHOST: localhost
PGPORT: 5432
PGDATABASE: test
PGUSER: postgres
PGPASSWORD: postgres
steps:
- name: Check out branch
uses: actions/checkout@v3
- name: Install PostgreSQL 15 client
run: |
echo '::group::Add PostgreSQL APT repository'
echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
echo '::endgroup::'
echo '::group::Install PostgreSQL GPG key'
wget --quiet --output-document - -- https://www.postgresql.org/media/keys/ACCC4CF8.asc \
| gpg --dearmor \
| sudo tee /etc/apt/trusted.gpg.d/postgresql.gpg > /dev/null
echo '::endgroup::'
echo '::group::Update package list and install the PostgreSQL 15 client (psql)'
sudo apt-get update
sudo apt-get --yes install -- postgresql-client-15
echo '::endgroup::'
- name: Run tests
run: test/test.sh