Skip to content

Use GitHub actions for CI instead of Travis #879

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

Merged
merged 2 commits into from
Dec 28, 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
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests
on: [push, pull_request]

jobs:
test:
name: Run test
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.django-rest-framework == 'master' }}
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
django: ["2.2", "3.0", "3.1"]
django-rest-framework: ["3.12", "master"]
env:
PYTHON: ${{ matrix.python-version }}
DJANGO: ${{ matrix.django }}
DJANGO_REST_FRAMEWORK: ${{ matrix.django-rest-framework }}
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
pip install tox tox-gh-actions
- name: Test with tox
run: tox
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
env_vars: PYTHON,DJANGO,DJANGO_REST_FRAMEWORK
check:
name: Run check
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tox-env: ["black", "lint", "docs"]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run lint
run: tox
env:
TOXENV: ${{ matrix.tox-env }}
88 changes: 0 additions & 88 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
JSON API and Django Rest Framework
==================================

.. image:: https://travis-ci.com/django-json-api/django-rest-framework-json-api.svg?branch=master
:target: https://travis-ci.com/django-json-api/django-rest-framework-json-api
.. image:: hhttps://github.com/django-json-api/django-rest-framework-json-api/workflows/Tests/badge.svg
:alt: Tests
:target: https://github.com/django-json-api/django-rest-framework-json-api/actions

.. image:: https://readthedocs.org/projects/django-rest-framework-json-api/badge/?version=latest
:alt: Read the docs
Expand Down
17 changes: 17 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ envlist =
py{36,37,38,39}-django{22,30,31}-drf{312,master},
lint,docs

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

[gh-actions:env]
DJANGO =
2.2: django22
3.0: django30
3.1: django31

DJANGO_REST_FRAMEWORK =
3.12: drf312
master: drfmaster

[testenv]
deps =
django22: Django>=2.2,<2.3
Expand Down