Skip to content

Commit

Permalink
Switch from travis to github actions, coverage to use xml instead of …
Browse files Browse the repository at this point in the history
…html.
  • Loading branch information
sdolemelipone committed Jun 21, 2021
1 parent 7fbdaef commit 0a84408
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 56 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ dist/
.idea
nosetests.xml
*.sqlite3

coverage.xml
/.tox/
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
|travis| |codecov| |docs-status|
|build| |codecov| |docs-status|

Django Extra Views - The missing class-based generic views for Django
========================================================================
Expand All @@ -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
Expand Down
14 changes: 12 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a84408

Please sign in to comment.