From 0a84408c04c9b37121fb9696b93290d530593d92 Mon Sep 17 00:00:00 2001 From: sdolemelipone Date: Mon, 21 Jun 2021 10:39:34 +0100 Subject: [PATCH] Switch from travis to github actions, coverage to use xml instead of html. --- .github/workflows/tests.yml | 33 ++++++++++++++++++++++++ .gitignore | 2 +- .travis.yml | 50 ------------------------------------- README.rst | 6 ++--- tox.ini | 14 +++++++++-- 5 files changed, 49 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..68fa4c4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,33 @@ +name: Tests +on: [push, pull_request] +jobs: + tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + name: Python ${{ matrix.python-version }} + 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 + python -m pip install tox tox-gh-actions + - name: Run tests with tox + run: tox + - name: Upload coverage.xml + if: ${{ matrix.python-version == '3.9' }} + uses: actions/upload-artifact@v2 + with: + name: django-extra-views-coverage + path: coverage.xml + if-no-files-found: error + - name: Upload coverage.xml to Codecov + if: ${{ matrix.python-version == '3.9' }} + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index 28aa5f4..ba4939c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,5 @@ dist/ .idea nosetests.xml *.sqlite3 - +coverage.xml /.tox/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 74afc83..0000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -sudo: false -language: python - -python: - - "3.5" - - "3.6" - - "3.7" - - "3.8" - - "3.9" - -env: - - DJANGO=django21 - - DJANGO=django22 - - DJANGO=django30 - - DJANGO=django31 - - DJANGO=django32 - - DJANGO=djangomaster - -matrix: - exclude: - - python: "3.5" - env: DJANGO=django30 - - python: "3.5" - env: DJANGO=django31 - - python: "3.5" - env: DJANGO=django32 - - python: "3.5" - env: DJANGO=djangomaster - - python: "3.6" - env: DJANGO=djangomaster - - python: "3.7" - env: DJANGO=djangomaster - - python: "3.8" - env: DJANGO=django21 - - python: "3.9" - env: DJANGO=django21 - allow_failures: - - env: DJANGO=djangomaster - -before_install: - - pip install codecov - -install: - - pip install tox - -script: - - TOX_TEST_PASSENV="TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH" tox -e py${TRAVIS_PYTHON_VERSION//[.]/}-$DJANGO - -after_success: - - codecov diff --git a/README.rst b/README.rst index 7be8355..9cf2733 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -|travis| |codecov| |docs-status| +|build| |codecov| |docs-status| Django Extra Views - The missing class-based generic views for Django ======================================================================== @@ -14,8 +14,8 @@ Full documentation is available at `read the docs`_. .. _read the docs: https://django-extra-views.readthedocs.io/ -.. |travis| image:: https://secure.travis-ci.org/AndrewIngram/django-extra-views.svg?branch=master - :target: https://travis-ci.org/AndrewIngram/django-extra-views +.. |build| image:: https://github.com/AndrewIngram/django-extra-views/workflows/Tests/badge.svg + :target: https://github.com/AndrewIngram/django-extra-views/ :alt: Build Status .. |codecov| image:: https://codecov.io/github/AndrewIngram/django-extra-views/coverage.svg?branch=master diff --git a/tox.ini b/tox.ini index 82bc66e..073c268 100644 --- a/tox.ini +++ b/tox.ini @@ -6,14 +6,24 @@ envlist = py35-django{21,22} py39-django{22,30,31,32,master} docs +[gh-actions] +python = + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39, docs, lint + [testenv] setenv = PYTHONPATH = {toxinidir} PYTHONWARNINGS = all - PYTEST_ADDOPTS = --cov --cov-fail-under=85 --cov-report=html --cov-report=term + PYTEST_ADDOPTS = --cov --cov-fail-under=85 --cov-report=xml --cov-report=term +# The dash ahead of the command allows djangomaster to fail and still return 0 (success) commands = - pytest {posargs} + !djangomaster: pytest {posargs} + djangomaster: -pytest {posargs} deps = django21: Django>=2.1,<2.2