Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to GitHub Actions #907

Merged
merged 12 commits into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
if: github.repository == 'jazzband/django-oauth-toolkit'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel

- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*

- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-oauth-toolkit/upload
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.5' ,'3.6', '3.7', '3.8', '3.9']

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 Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions

- name: Tox tests
run: |
tox -v

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Django OAuth Toolkit
.. image:: https://badge.fury.io/py/django-oauth-toolkit.png
:target: http://badge.fury.io/py/django-oauth-toolkit

.. image:: https://travis-ci.org/jazzband/django-oauth-toolkit.png
:alt: Build Status
:target: https://travis-ci.org/jazzband/django-oauth-toolkit

.. image:: https://coveralls.io/repos/github/jazzband/django-oauth-toolkit/badge.svg?branch=master
:alt: Coverage Status
:target: https://coveralls.io/github/jazzband/django-oauth-toolkit?branch=master
.. image:: https://github.com/jazzband/django-oauth-toolkit/workflows/Test/badge.svg
:target: https://github.com/jazzband/django-oauth-toolkit/actions
:alt: GitHub Actions

.. image:: https://codecov.io/gh/jazzband/django-oauth-toolkit/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jazzband/django-oauth-toolkit
:alt: Coverage

If you are facing one or more of the following:
* Your Django app exposes a web API you want to protect with OAuth2 authentication,
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ When you begin your PR, you'll be asked to provide the following:
* Any new or changed code requires that a unit test be added or updated. Make sure your tests check for
correct error behavior as well as normal expected behavior. Strive for 100% code coverage of any new
code you contribute! Improving unit tests is always a welcome contribution.
If your change reduces coverage, you'll be warned by `coveralls <https://coveralls.io/>`_.
If your change reduces coverage, you'll be warned by `Codecov <https://codecov.io/>`_.

* Update the documentation (in `docs/`) to describe the new or changed functionality.

Expand Down Expand Up @@ -190,7 +190,7 @@ You can check your coverage locally with the `coverage <https://pypi.org/project

Open mycoverage/index.html in your browser and you can see a coverage summary and coverage details for each file.

There's no need to wait for coveralls to complain after you submit your PR.
There's no need to wait for Codecov to complain after you submit your PR.

Code conventions matter
-----------------------
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ long_description_content_type = text/x-rst
author = Federico Frenguelli, Massimiliano Pippi
author_email = [email protected]
url = https://github.com/jazzband/django-oauth-toolkit
download_url = https://github.com/jazzband/django-oauth-toolkit/tarball/master
keywords = django, oauth, oauth2, oauthlib
classifiers =
Development Status :: 5 - Production/Stable
Expand Down
103 changes: 55 additions & 48 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,74 +1,81 @@
[tox]
envlist =
py37-flake8,
py37-docs,
py39-django{31,30,22},
py38-django{31,30,22},
py37-django{31,30,22},
py36-django{31,30,22},
py35-django{22},
py39-djangomaster,
py38-djangomaster,
py37-djangomaster,
py36-djangomaster,
flake8,
docs,
py{36,37,38,39}-dj{31,30,22},
py35-dj{22},
py{36,37,38,39}-djmaster,

[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38, docs
3.9: py39

[pytest]
django_find_project = false

[testenv]
commands = pytest --cov=oauth2_provider --cov-report= --cov-append {posargs}
commands =
pytest --cov=oauth2_provider --cov-report= --cov-append {posargs}
coverage report
coverage xml
setenv =
DJANGO_SETTINGS_MODULE = tests.settings
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = all
DJANGO_SETTINGS_MODULE = tests.settings
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = all
deps =
django22: Django>=2.2,<3
django30: Django>=3.0,<3.1
django31: Django>=3.1,<3.2
djangomaster: https://github.com/django/django/archive/master.tar.gz
djangorestframework
oauthlib>=3.1.0
coverage
pytest
pytest-cov
pytest-django
pytest-xdist
py27: mock
requests
dj22: Django>=2.2,<3
dj30: Django>=3.0,<3.1
dj31: Django>=3.1,<3.2
djmaster: https://github.com/django/django/archive/master.tar.gz
djangorestframework
oauthlib>=3.1.0
coverage
pytest
pytest-cov
pytest-django
pytest-xdist
requests
passenv =
PYTEST_ADDOPTS

[testenv:py37-docs]
basepython = python
[testenv:py{36,37,38,39}-djmaster]
ignore_errors = true
ignore_outcome = true

[testenv:docs]
basepython = python3.8
changedir = docs
whitelist_externals = make
commands = make html
deps =
sphinx<3
oauthlib>=3.1.0
m2r>=0.2.1
sphinx<3
oauthlib>=3.1.0
m2r>=0.2.1

[testenv:py37-flake8]
[testenv:flake8]
basepython = python3.8
skip_install = True
commands =
flake8 {toxinidir}
commands = flake8 {toxinidir}
deps =
flake8
flake8-isort
flake8-quotes
flake8-black
flake8
flake8-isort
flake8-quotes
flake8-black

[testenv:install]
deps =
twine
setuptools>=39.0
wheel
whitelist_externals=
rm
twine
setuptools>=39.0
wheel
whitelist_externals = rm
commands =
rm -rf dist
python setup.py sdist bdist_wheel
twine upload dist/*
rm -rf dist
python setup.py sdist bdist_wheel
twine upload dist/*


[coverage:run]
Expand Down