Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test workflow #41

Merged
merged 12 commits into from
Oct 26, 2020
Merged
61 changes: 0 additions & 61 deletions .github/workflows/pythonpackage.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: test

on: pull_request

jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: "3"
- name: Load cached wheels
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies
run: |
python -m pip install pip -U
python -m pip install black flake8 isort
- name: Run checks
run: |
flake8 .
black . --check
isort .
test:
needs: linting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.6", "3.7", "3.8", "3.9" ]
django-version: [ "2.2", "3.0", "3.1" ]
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: dschep/install-poetry-action@v1.3
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
poetry config virtualenvs.create true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-4
- name: Install dependencies
run: |
source $HOME/.poetry/env
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install django ${{ matrix.django-version }}
run: |
source $HOME/.poetry/env
python -m pip install "Django==${{ matrix.django-version }}" --upgrade --force-reinstall
- name: Run tests
run: |
source $HOME/.poetry/env
poetry run pytest --cov=django_guid tests/
poetry run coverage report


11 changes: 0 additions & 11 deletions .isort.cfg

This file was deleted.

17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ classifiers = [
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Internet :: WWW/HTTP :: WSGI',
Expand Down Expand Up @@ -60,6 +62,21 @@ exclude = '''
)
'''

[tool.isort]
profile = "black"
src_paths = ["django_guid"]
combine_as_imports = true
line_length = 120
sections = [
'FUTURE',
'STDLIB',
'DJANGO',
'THIRDPARTY',
'FIRSTPARTY',
'LOCALFOLDER'
]
known_django = ['django']

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"