Skip to content

Commit dfefa70

Browse files
committed
Added gh actions
1 parent 670d58a commit dfefa70

File tree

3 files changed

+67
-8
lines changed

3 files changed

+67
-8
lines changed

.github/workflows/main.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
tests_python:
14+
name: Test on Python ${{ matrix.python_version }} and Django ${{ matrix.django_version }}
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
django_version: [ '2.2', '3.0', '3.1', '3.2' ]
19+
python_version: [ '3.5', '3.6', '3.7', '3.8', '3.9' ]
20+
exclude:
21+
- django_version: '3.0'
22+
python_version: '3.5'
23+
24+
- django_version: '3.1'
25+
python_version: '3.5'
26+
27+
- django_version: '3.2'
28+
python_version: '3.5'
29+
env:
30+
SPATIALITE_LIBRARY_PATH: 'mod_spatialite.so'
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
33+
34+
steps:
35+
- uses: actions/checkout@v2
36+
- name: Set up Python ${{ matrix.python_version }}
37+
uses: actions/setup-python@v2
38+
with:
39+
python-version: ${{ matrix.python_version }}
40+
- name: Cache pip
41+
uses: actions/cache@v2
42+
with:
43+
# This path is specific to Ubuntu
44+
path: ~/.cache/pip
45+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ matrix.django_version }}
46+
- name: Install dependencies
47+
run: |
48+
sudo apt-get update -qq
49+
sudo apt-get install -y libproj-dev libgeos-dev gdal-bin libgdal-dev libsqlite3-mod-spatialite
50+
python -m pip install --upgrade pip
51+
pip install -U flake8 coveralls argparse jsonfield
52+
pip install -U Django~=${{ matrix.django_version }}.0
53+
- name: Lint with flake8
54+
run: |
55+
flake8 --ignore=E501,W504 djgeojson
56+
- name: Test
57+
run: |
58+
python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m coverage run ./quicktest.py djgeojson
59+
- name: Coverage
60+
if: ${{ success() }}
61+
run: |
62+
coveralls

quicktest.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,10 @@ def run_tests(self):
3939
'default': {
4040
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
4141
'NAME': os.path.join(self.DIRNAME, 'database.db'),
42-
'USER': '',
43-
'PASSWORD': '',
44-
'HOST': '',
45-
'PORT': '',
4642
}
4743
},
4844
INSTALLED_APPS=self.INSTALLED_APPS + self.apps,
49-
SPATIALITE_LIBRARY_PATH='mod_spatialite',
45+
SPATIALITE_LIBRARY_PATH=os.getenv('SPATIALITE_LIBRARY_PATH', 'mod_spatialite'),
5046
TEMPLATES=[
5147
{
5248
'BACKEND': 'django.template.backends.django.DjangoTemplates',

tox.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
[tox]
77
envlist =
88
py35-django{22}
9-
py36-django{22,30,31}
10-
py37-django{22,30,31}
11-
py38-django{22,30,31}
9+
py36-django{22,30,31,32}
10+
py37-django{22,30,31,32}
11+
py38-django{22,30,31,32}
12+
py39-django{22,30,31,32}
1213

1314
[testenv]
1415
commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning -W ignore:::site -W ignore:::distutils quicktest.py djgeojson

0 commit comments

Comments
 (0)