Skip to content

Commit 980b82b

Browse files
committed
Add gh action
1 parent a443f9d commit 980b82b

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Django CI
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 4
10+
matrix:
11+
python-version: ['3.12']
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup PostgreSQL with Postgis
16+
uses: nyurik/[email protected]
17+
with:
18+
database: vbos
19+
id: postgres
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v2
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install Dependencies
25+
run: |
26+
sudo apt-get update -qq -y
27+
sudo apt-get install -y binutils libproj-dev python3-gdal libgeos-dev libyaml-dev
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
- name: Run Tests
31+
run: |
32+
coverage run manage.py test --settings=vbos.config.local
33+
env:
34+
DATABASE_URL: ${{ secrets.DATABASE_URL }}
35+
DJANGO_SECRET_KEY: ${{ secrets.DJANGO_SECRET_KEY }}

vbos/config/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class Common(Configuration):
5151
# Postgres
5252
DATABASES = {
5353
'default': dj_database_url.config(
54-
default='postgres://postgres:@postgres:5432/vbos',
54+
default='postgis://postgres:@postgres:5432/vbos',
5555
conn_max_age=int(os.getenv('POSTGRES_CONN_MAX_AGE', 600))
5656
)
5757
}

0 commit comments

Comments
 (0)