Skip to content

Commit 9f4f2ef

Browse files
authored
Merge pull request #225 from mlavin/github-actions
github actions
2 parents ed47d78 + 653b727 commit 9f4f2ef

File tree

3 files changed

+71
-6
lines changed

3 files changed

+71
-6
lines changed

.github/workflows/tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-python@v3
15+
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip tox
19+
- name: Lint with flake8
20+
run: |
21+
tox -e lint
22+
test:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
python-version: [ "3.9", "3.10", "3.11"]
28+
django-version: [ "3.2", "4.2"]
29+
env:
30+
PY_VER: ${{ matrix.python-version}}
31+
DJ_VER: ${{ matrix.django-version}}
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- name: Set up Python ${{ matrix.python-version }}
37+
uses: actions/setup-python@v3
38+
with:
39+
python-version: ${{ matrix.python-version }}
40+
41+
- name: Install dependencies
42+
run: python -m pip install --upgrade pip tox
43+
44+
- name: Test with
45+
run: tox -e py${PY_VER//.}-dj${DJ_VER//.}
46+
47+
- uses: codecov/codecov-action@v2
48+
with:
49+
verbose: true

example/example/settings.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
DATABASES = {
1111
"default": {
12-
"ENGINE": "django.db.backends.sqlite3", # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
13-
"NAME": "example.db", # Or path to database file if using sqlite3.
14-
"USER": "", # Not used with sqlite3.
15-
"PASSWORD": "", # Not used with sqlite3.
16-
"HOST": "", # Set to empty string for localhost. Not used with sqlite3.
17-
"PORT": "", # Set to empty string for default. Not used with sqlite3.
12+
"ENGINE": "django.db.backends.sqlite3",
13+
"NAME": "example.db",
14+
"USER": "",
15+
"PASSWORD": "",
16+
"HOST": "",
17+
"PORT": "",
1818
}
1919
}
2020

tox.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ envlist =
33
py{39,310,311}-dj{32,42}
44
docs
55

6+
[flake8]
7+
max-line-length = 120
8+
ignore =
9+
10+
exclude =
11+
*/migrations,
12+
613
[testenv]
714
deps =
815
coverage>=4.0
@@ -17,3 +24,12 @@ deps =
1724
Django
1825
commands =
1926
{envbindir}/sphinx-build -a -n -b html -d docs/_build/doctrees docs docs/_build/html
27+
28+
29+
[testenv:lint]
30+
envdir={toxworkdir}/py39-d41/
31+
skip_install = true
32+
commands =
33+
pip install flake8 isort
34+
flake8 selectable example
35+
isort -c selectabe example

0 commit comments

Comments
 (0)