diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..39ed69d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +name: Build + +on: + push: + branches: + - master + + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + container: + - image: python:3.7 + toxenv: py37 + - image: python:3.8 + toxenv: py38 + - image: python:3.9 + toxenv: py39 + + container: + image: ${{ matrix.container.image }} + + steps: + - uses: actions/checkout@v1 + - name: Install dependencies + run: | + pip install -r requirements.txt + - name: Tox + run: | + tox -f ${{ matrix.container.toxenv }} + - name: Upload Coverage + run: coveralls + env: + GITHUB_TOKEN: ${{ secrets.github_token }} + COVERALLS_FLAG_NAME: ${{ matrix.container.image }} + COVERALLS_PARALLEL: true + + finish: + needs: build + runs-on: ubuntu-latest + container: python:3-slim + steps: + - name: Coveralls Finished + run: | + pip3 install -U coveralls + coveralls --finish + env: + GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 02a90d4..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -language: python -branches: - only: - - master -cache: - directories: - - $HOME/.cache/pip - - $HOME/.cache/pre-commit - -python: - - "3.7" - - "3.8" - -install: - - pip install tox-travis - -script: - - tox - -after_success: - coveralls diff --git a/README.rst b/README.rst index 487f8fc..b0f819b 100644 --- a/README.rst +++ b/README.rst @@ -7,8 +7,8 @@ Django REST Dataclasses Provides serializers for dataclasses -.. |Build Status| image:: https://travis-ci.com/shosca/django-rest-dataclasses.svg?branch=master - :target: https://travis-ci.com/shosca/django-rest-dataclasses +.. |Build Status| image:: https://github.com/shosca/django-rest-dataclasses/workflows/Build/badge.svg?branch=master + :target: https://github.com/shosca/django-rest-dataclasses/actions?query=workflow%3ABuild+branch%3Amaster .. |PyPI version| image:: https://badge.fury.io/py/django-rest-dataclasses.svg :target: https://badge.fury.io/py/django-rest-dataclasses .. |Coveralls Status| image:: https://coveralls.io/repos/github/shosca/django-rest-dataclasses/badge.svg?branch=master diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2ab9fac --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,31 @@ +version: '3.7' + +services: + py36: &base + image: python:3.6 + working_dir: /code + entrypoint: /code/entrypoint.sh + command: tox -f py36 + volumes: + - .:/code + - /tmp:/root/.cache + + py37: + image: python:3.7 + command: tox -f py37 + <<: *base + + py38: + image: python:3.8 + command: tox -f py38 + <<: *base + + py39: + image: python:3.9 + command: tox -f py39 + <<: *base + + pypy36: + image: pypy:3.6 + command: tox -f pypy36 + <<: *base diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..bf4cd82 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +pip install -r requirements.txt + +exec "$@" diff --git a/requirements.txt b/requirements.txt index e01a0d5..5fb06de 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,20 @@ -e . +Sphinx +coreapi +coreschema +coveralls +flake8 +flake8-bugbear +flake8-comprehensions +flake8-django +gitchangelog +pre_commit +pdbpp pytest pytest-cov -flake8 -flake8-bugbear; python_version > '2.7' simplejson sphinx-autobuild -gitchangelog -yapf -pdbpp -pre_commit -Sphinx sphinx_rtd_theme -mock; python_version <= '2.7' tox +tox-factor tox-pyenv -coveralls diff --git a/tox.ini b/tox.ini index 47957b1..41c976d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] skipsdist = true envlist = - {py37,py38}-{dj20,dj21,dj22}-{drf38,drf39,drf310} - {py37,py38}-{dj30}-{drf310} - {py37,py38}-{dj31}-{drf311} + {py37,py38,py39}-{dj20,dj21,dj22}-{drf38,drf39,drf310} + {py37,py38,py39}-{dj30}-{drf310} + {py37,py38,py39}-{dj31}-{drf311} [testenv] passenv = @@ -17,33 +17,25 @@ passenv = basepython = py37: python3.7 py38: python3.8 + py39: python3.9 deps = - dj11: django<2 - dj20: django<2.1 - dj21: django<2.2 - dj22: django<2.3 - dj30: django<3.1 - dj31: django<3.2 - drf38: djangorestframework<3.9 - drf39: djangorestframework<3.10 - drf310: djangorestframework<3.11 - drf311: djangorestframework<4 + dj11: django==1.11.* + dj20: django==2.0.* + dj21: django==2.1.* + dj22: django==2.2.* + dj30: django==3.0.* + dj31: django==3.1.* + drf38: djangorestframework==3.8.* + drf39: djangorestframework==3.9.* + drf310: djangorestframework==3.10.* + drf311: djangorestframework==3.11.* -rrequirements.txt setenv = - COVERAGE_FLAGS = + COVERAGE_FLAGS = --cov-fail-under=100 whitelist_externals = make commands = pip freeze make coverage - -[testenv:py37] -setenv = - COVERAGE_FLAGS = --cov-fail-under=100 - -[testenv:py38] -setenv = - COVERAGE_FLAGS = --cov-fail-under=100 - commands_pre = make lint