Skip to content

Commit

Permalink
Merge pull request #115 from hmpf/setup-gh-actions
Browse files Browse the repository at this point in the history
Set up Github actions
  • Loading branch information
hmpf authored Sep 25, 2020
2 parents 8c9ff18 + c1effe5 commit 2327fae
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 3 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Python package

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip "setuptools<46" wheel
pip install tox tox-gh-actions
- name: Lint with flake8
run: |
tox -e flake8
- name: Test with tox
run: |
tox
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
Easydmp Django Project
======================

.. image:: https://github.com/hmpf/easydmp/workflows/Python%20package/badge.svg

This project has been designed to be installable via ``setup.py``.

Layout:
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dj-database-url>=0.5.0
docutils>=0.16
graphviz>=0.13.2
jsonfield2>=3.0,<3.1
MarkupSafe==1.0
MarkupSafe>1.0,<2.0
psycopg2 --no-binary=psycopg2
pytz>=2020.1
social-auth-app-django>=3.1
Expand Down
18 changes: 16 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,35 @@
envlist =
clean
py{38}-django{22}
coverage
coverage-xml
skipsdist = True

[gh-actions]
python =
3.8: py38

[testenv:clean]
whitelist_externals = make
deps =
commands =
make clean

[testenv:coverage]
[testenv:coverage-html]
basepython = python3.8
deps =
coverage
commands =
-coverage combine
coverage html --include="./src/*" --omit="*/admin.py,*/test*,*/migrations/*"

[testenv:coverage-xml]
basepython = python3.8
deps =
coverage
commands =
-coverage combine
coverage xml --include="./src/*" --omit="*/admin.py,*/test*,*/migrations/*"

[testenv:flake8]
basepython = python3.8
deps =
Expand All @@ -36,6 +48,8 @@ exclude = .git,__pycache__,docs,migrations,*.py?,static,templates,*.csv,*.json
deps =
django22: django>=2.2,<2.3
django30: django>=3.0,<3.1
django31: django>=3.1,<3.2
django_latest: django
-rrequirements/base.txt
-rrequirements/testing.txt
setenv =
Expand Down

0 comments on commit 2327fae

Please sign in to comment.