Skip to content

Commit

Permalink
Add GitHub Actions test workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Jan 28, 2021
1 parent 5808e44 commit ce8f668
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 48 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test

on: [push, pull_request]

jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
django-version: ['2.2', '3.0', '3.1', 'dev']

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Tox tests
run: |
tox -v
env:
DJANGO: ${{ matrix.django-version }}

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ django_setuptest*
docs/_*
.idea/
venv/
coverage.xml
.tox
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Thanks for your awesome contrib! If you'd like to have your code included in mas
couple of things you have to take care of though:

1. Ensure that the way you implemented the functionality is generic enough for other users to make use of and does not degrade the performance of existing users. If you unsure about this, create an issue with proposed functionality to discuss with the collaborators first.
2. Make sure the tests are passing. In any case, Travis should report passing tests.
3. Extended tests to cover any additional code included in your commit. In any case, the coveralls report should report equal or increased coverage.
2. Make sure the tests are passing. In any case, GitHub Actions should report passing tests.
3. Extended tests to cover any additional code included in your commit. In any case, the Codecov report should report equal or increased coverage.
4. Make sure that any added or changed functionality is documented in the Sphinx documentation.
11 changes: 6 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ django-newsletter
.. image:: https://img.shields.io/pypi/v/django-newsletter.svg
:target: https://pypi.python.org/pypi/django-newsletter

.. image:: https://img.shields.io/travis/jazzband/django-newsletter/master.svg
:target: http://travis-ci.org/jazzband/django-newsletter
.. image:: https://github.com/jazzband/django-newsletter/workflows/Test/badge.svg
:target: https://github.com/jazzband/django-newsletter/actions
:alt: GitHub Actions

.. image:: https://coveralls.io/repos/github/jazzband/django-newsletter/badge.svg?branch=master
:target: https://coveralls.io/github/jazzband/django-newsletter?branch=master
.. image:: https://codecov.io/gh/jazzband/django-newsletter/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jazzband/django-newsletter

.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
Expand Down Expand Up @@ -58,7 +59,7 @@ Fairly extensive tests are available for internal frameworks, web
(un)subscription and mail sending. Sending a newsletter to large groups of recipients
(+15k) has been confirmed to work in multiple production environments. Tests
for pull req's and the master branch are automatically run through
`Travis CI <http://travis-ci.org/jazzband/django-newsletter>`_.
`GitHub Actions <https://github.com/jazzband/django-newsletter/actions>`_.

Contributing
=============
Expand Down

0 comments on commit ce8f668

Please sign in to comment.