Skip to content

Commit 902114b

Browse files
committed
Move test suite to GitHub actions
1 parent 6423d4d commit 902114b

File tree

6 files changed

+76
-41
lines changed

6 files changed

+76
-41
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: CI
2+
on: [pull_request]
3+
jobs:
4+
docs:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/setup-python@v1.1.1
8+
- uses: actions/checkout@v2.0.0
9+
- run: python -m pip install -r requirements.txt
10+
- run: python setup.py develop
11+
- run: python setup.py build_sphinx -W
12+
13+
SQLite:
14+
needs: [docs]
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
python-version: [3.6, 3.7, 3.8]
19+
steps:
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v1.1.1
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- uses: actions/checkout@v2.0.0
25+
- run: python setup.py test
26+
- name: Codecov
27+
run: |
28+
python -m pip install codecov
29+
codecov -t ${{secrets.CODECOV_TOKEN}}
30+
31+
32+
PostgreSQL:
33+
needs: [docs]
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
python-version: [3.8]
38+
django-version:
39+
- "2.2"
40+
- "3.0"
41+
services:
42+
postgres:
43+
image: postgres
44+
env:
45+
POSTGRES_USER: django
46+
POSTGRES_PASSWORD: django
47+
ports:
48+
- 5432/tcp
49+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
50+
steps:
51+
- name: Set up Python ${{ matrix.python-version }}
52+
uses: actions/setup-python@v1.1.1
53+
with:
54+
python-version: ${{ matrix.python-version }}
55+
- uses: actions/checkout@v2.0.0
56+
- run: python -m pip install psycopg2-binary Django~=${{ matrix.django-version }}
57+
- run: python setup.py test
58+
env:
59+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
60+
DB: pg
61+
- name: Codecov
62+
run: |
63+
python -m pip install codecov
64+
codecov -t ${{secrets.CODECOV_TOKEN}}

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.. include:: ../CONTRIBUTING.rst
1+
.. include:: ../CONTRIBUTING.rst

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Django>=1.11
1+
Django>=2.2
2+
Wagtail>=2.8

setup.cfg

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ keywords = django, otp, password, email
2828
include_package_data = True
2929
packages = find:
3030
install_requires =
31-
django>=2.0
31+
django>=2.2
3232
setup_requires =
3333
setuptools_scm
3434
sphinx
@@ -42,6 +42,9 @@ tests_require =
4242
[options.package_data]
4343
* = *.txt, *.rst, *.html, *.po
4444

45+
[options.extras_require]
46+
wagtail = wagtail>=2.8
47+
4548
[options.packages.find]
4649
exclude =
4750
tests

tests/testapp/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@
100100
DATABASES = {
101101
'default': {
102102
'ENGINE': 'django.db.backends.postgresql',
103-
'NAME': 'django-test',
103+
'HOST': '127.0.0.1',
104+
'PORT': int(os.getenv('DB_PORT', 3306)),
105+
'NAME': 'default_django',
106+
'USER': 'django',
107+
'PASSWORD': 'django',
104108
}
105109
}
106110

0 commit comments

Comments
 (0)