Skip to content

Commit 986df87

Browse files
authored
Merge pull request #879 from sliverc/github_actions
Use GitHub actions for CI instead of Travis
2 parents 848d850 + d9cd0d3 commit 986df87

File tree

4 files changed

+75
-90
lines changed

4 files changed

+75
-90
lines changed

.github/workflows/tests.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
test:
6+
name: Run test
7+
runs-on: ubuntu-latest
8+
continue-on-error: ${{ matrix.django-rest-framework == 'master' }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: ["3.6", "3.7", "3.8", "3.9"]
13+
django: ["2.2", "3.0", "3.1"]
14+
django-rest-framework: ["3.12", "master"]
15+
env:
16+
PYTHON: ${{ matrix.python-version }}
17+
DJANGO: ${{ matrix.django }}
18+
DJANGO_REST_FRAMEWORK: ${{ matrix.django-rest-framework }}
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install tox tox-gh-actions
29+
- name: Test with tox
30+
run: tox
31+
- name: Upload coverage report
32+
uses: codecov/codecov-action@v1
33+
with:
34+
env_vars: PYTHON,DJANGO,DJANGO_REST_FRAMEWORK
35+
check:
36+
name: Run check
37+
runs-on: ubuntu-latest
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
tox-env: ["black", "lint", "docs"]
42+
steps:
43+
- uses: actions/checkout@v2
44+
- name: Set up Python 3.6
45+
uses: actions/setup-python@v2
46+
with:
47+
python-version: 3.6
48+
- name: Install dependencies
49+
run: |
50+
python -m pip install --upgrade pip
51+
pip install tox
52+
- name: Run lint
53+
run: tox
54+
env:
55+
TOXENV: ${{ matrix.tox-env }}

.travis.yml

-88
This file was deleted.

README.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
JSON API and Django Rest Framework
33
==================================
44

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

89
.. image:: https://readthedocs.org/projects/django-rest-framework-json-api/badge/?version=latest
910
:alt: Read the docs

tox.ini

+17
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@ envlist =
33
py{36,37,38,39}-django{22,30,31}-drf{312,master},
44
lint,docs
55

6+
[gh-actions]
7+
python =
8+
3.6: py36
9+
3.7: py37
10+
3.8: py38
11+
3.9: py39
12+
13+
[gh-actions:env]
14+
DJANGO =
15+
2.2: django22
16+
3.0: django30
17+
3.1: django31
18+
19+
DJANGO_REST_FRAMEWORK =
20+
3.12: drf312
21+
master: drfmaster
22+
623
[testenv]
724
deps =
825
django22: Django>=2.2,<2.3

0 commit comments

Comments
 (0)