Skip to content

Commit db911c8

Browse files
committed
Add postgres service
1 parent d58f2bc commit db911c8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.github/workflows/tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,21 @@ on: pull_request
55
jobs:
66
unit-tests:
77
runs-on: ubuntu-latest
8+
89
strategy:
910
matrix:
1011
python-version: [3.7, 3.8]
1112
django-version: [2.1, 2.2]
13+
14+
services:
15+
postgres:
16+
image: postgres
17+
ports: ["5432:5432"]
18+
19+
env:
20+
POSTGRES_PASSWORD: postgres
21+
POSTGRES_DB: django-cursor-pagination
22+
1223
steps:
1324
- uses: actions/checkout@v2
1425
- name: Set up Python
@@ -19,5 +30,4 @@ jobs:
1930
run: pip install django==${{ matrix.django-version }}
2031
- run: pip install psycopg2
2132
- run: pip install -e .
22-
- run: psql -c 'CREATE DATABASE "django-cursor-pagination"' -U postgres;
2333
- run: python runtests.py

tests/settings.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
'default': {
33
'ENGINE': 'django.db.backends.postgresql_psycopg2',
44
'NAME': 'django-cursor-pagination',
5+
'USER': 'postgres',
6+
'PASSWORD': 'postgres',
7+
'HOST': 'localhost',
8+
'PORT': '5432',
59
}
610
}
711

0 commit comments

Comments
 (0)