Skip to content

Commit 68f8a1c

Browse files
committed
Run CI for postgis service.
Include mention in the docs about how to configure the user locally to install PostgreSQL extensions.
1 parent 50886da commit 68f8a1c

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

.github/workflows/test.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,73 @@ jobs:
142142
with:
143143
name: Python ${{ matrix.python-version }}
144144

145+
postgis:
146+
runs-on: ubuntu-latest
147+
strategy:
148+
fail-fast: false
149+
max-parallel: 5
150+
matrix:
151+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
152+
153+
services:
154+
postgres:
155+
image: postgis/postgis:14-3.1
156+
env:
157+
POSTGRES_DB: debug_toolbar
158+
POSTGRES_USER: debug_toolbar
159+
POSTGRES_PASSWORD: debug_toolbar
160+
ports:
161+
- 5432:5432
162+
options: >-
163+
--health-cmd pg_isready
164+
--health-interval 10s
165+
--health-timeout 5s
166+
--health-retries 5
167+
168+
steps:
169+
- uses: actions/checkout@v2
170+
171+
- name: Set up Python ${{ matrix.python-version }}
172+
uses: actions/setup-python@v2
173+
with:
174+
python-version: ${{ matrix.python-version }}
175+
176+
- name: Get pip cache dir
177+
id: pip-cache
178+
run: |
179+
echo "::set-output name=dir::$(pip cache dir)"
180+
181+
- name: Cache
182+
uses: actions/cache@v2
183+
with:
184+
path: ${{ steps.pip-cache.outputs.dir }}
185+
key:
186+
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/tox.ini') }}
187+
restore-keys: |
188+
${{ matrix.python-version }}-v1-
189+
190+
- name: Install enchant (only for docs)
191+
run: |
192+
sudo apt-get -qq update
193+
sudo apt-get -y install enchant
194+
195+
- name: Install dependencies
196+
run: |
197+
python -m pip install --upgrade pip
198+
python -m pip install --upgrade tox tox-gh-actions
199+
200+
- name: Test with tox
201+
run: tox
202+
env:
203+
DB_BACKEND: postgis
204+
DB_HOST: localhost
205+
DB_PORT: 5432
206+
207+
- name: Upload coverage
208+
uses: codecov/codecov-action@v1
209+
with:
210+
name: Python ${{ matrix.python-version }}
211+
145212
sqlite:
146213
runs-on: ubuntu-latest
147214
strategy:

docs/contributing.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ databases)::
8989
psql> CREATE DATABASE debug_toolbar;
9090
psql> GRANT ALL PRIVILEGES ON DATABASE debug_toolbar to debug_toolbar;
9191

92+
If you're going to test the PostGIS integration locally the PostgreSQL user
93+
will need to be a super user in order to create the extensions.
94+
95+
psql> ALTER USER debug_toolbar WITH SUPERUSER;
96+
9297
For MySQL/MariaDB in a ``mysql`` shell::
9398

9499
mysql> CREATE DATABASE debug_toolbar;

0 commit comments

Comments
 (0)