From c1effe5d46ed4c6b5e7bc303d45f9615d6c0805d Mon Sep 17 00:00:00 2001 From: Hanne Moa Date: Thu, 24 Sep 2020 13:30:11 +0200 Subject: [PATCH] Set up Github actions --- .github/workflows/tox.yml | 28 ++++++++++++++++++++++++++++ README.rst | 2 ++ requirements/base.txt | 2 +- tox.ini | 18 ++++++++++++++++-- 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/tox.yml diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml new file mode 100644 index 00000000..60d5e358 --- /dev/null +++ b/.github/workflows/tox.yml @@ -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 diff --git a/README.rst b/README.rst index 6252ec7c..849c0a1c 100644 --- a/README.rst +++ b/README.rst @@ -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: diff --git a/requirements/base.txt b/requirements/base.txt index cede2504..d5a55fbb 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -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 diff --git a/tox.ini b/tox.ini index d3695926..4d5e0fa3 100644 --- a/tox.ini +++ b/tox.ini @@ -2,16 +2,20 @@ 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 @@ -19,6 +23,14 @@ 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 = @@ -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 =