Skip to content

Commit

Permalink
Merge pull request #225 from mlavin/github-actions
Browse files Browse the repository at this point in the history
github actions
  • Loading branch information
domdinicola authored Jun 22, 2023
2 parents ed47d78 + 653b727 commit 9f4f2ef
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 6 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

on:
push:
branches:
- master
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3

- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
- name: Lint with flake8
run: |
tox -e lint
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11"]
django-version: [ "3.2", "4.2"]
env:
PY_VER: ${{ matrix.python-version}}
DJ_VER: ${{ matrix.django-version}}

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: python -m pip install --upgrade pip tox

- name: Test with
run: tox -e py${PY_VER//.}-dj${DJ_VER//.}

- uses: codecov/codecov-action@v2
with:
verbose: true
12 changes: 6 additions & 6 deletions example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3", # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
"NAME": "example.db", # Or path to database file if using sqlite3.
"USER": "", # Not used with sqlite3.
"PASSWORD": "", # Not used with sqlite3.
"HOST": "", # Set to empty string for localhost. Not used with sqlite3.
"PORT": "", # Set to empty string for default. Not used with sqlite3.
"ENGINE": "django.db.backends.sqlite3",
"NAME": "example.db",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
}
}

Expand Down
16 changes: 16 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ envlist =
py{39,310,311}-dj{32,42}
docs

[flake8]
max-line-length = 120
ignore =

exclude =
*/migrations,

[testenv]
deps =
coverage>=4.0
Expand All @@ -17,3 +24,12 @@ deps =
Django
commands =
{envbindir}/sphinx-build -a -n -b html -d docs/_build/doctrees docs docs/_build/html


[testenv:lint]
envdir={toxworkdir}/py39-d41/
skip_install = true
commands =
pip install flake8 isort
flake8 selectable example
isort -c selectabe example

0 comments on commit 9f4f2ef

Please sign in to comment.