From 63c3d7d2dc944e5c7448d27cd68e6268b8d6584a Mon Sep 17 00:00:00 2001 From: Sebastien Corbin Date: Mon, 17 Jan 2022 11:46:41 +0100 Subject: [PATCH] Move to github actions --- .github/workflows/actions.yml | 66 +++++++++++++++++++++++++++++++++++ .travis.yml | 46 ------------------------ tox.ini | 24 +++++++------ 3 files changed, 79 insertions(+), 57 deletions(-) create mode 100644 .github/workflows/actions.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml new file mode 100644 index 0000000..87d3ff2 --- /dev/null +++ b/.github/workflows/actions.yml @@ -0,0 +1,66 @@ +name: Run Tests + +on: [ push, pull_request ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + django_version: + - '2.2' + - '3.2' + - '4.0' + python_version: + - 3.6 + - 3.7 + - 3.8 + - 3.9 + - "3.10" + exclude: + - django_version: '2.2' + python_version: '3.10' + + - django_version: '4.0' + python_version: '3.6' + + - django_version: '4.0' + python_version: '3.7' + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python_version }} + uses: actions/setup-python@v2 + with: + python_version: ${{ matrix.python_version }} + + - name: Cache pip + uses: actions/cache@v2 + with: + # This path is specific to Ubuntu + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.python_version }}-${{ matrix.django_version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e . + pip install -U flake8 coveralls argparse + pip install -U Django~=${{ matrix.django_version }} + + - name: Lint with flake8 + run: flake8 --ignore=E501,W504 jsignature + + - name: Test Django + run: | + python -W error::DeprecationWarning -W error::PendingDeprecationWarning \ + -m coverage run runtests.py + + - name: Coverage + if: ${{ success() }} + run: | + coveralls --service=github diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4c6b6ee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: python - -matrix: - fast_finish: true - allow_failures: - - env: DJANGO=master - include: - - python: 2.7 - env: DJANGO=1.11 - - - python: 3.5 - env: DJANGO=1.11 - - python: 3.5 - env: DJANGO=2.2 - - - python: 3.6 - env: DJANGO=1.11 - - python: 3.6 - env: DJANGO=2.2 - - python: 3.6 - env: DJANGO=3.0 - - python: 3.6 - env: DJANGO=master - - - python: 3.7 - env: DJANGO=2.2 - - python: 3.7 - env: DJANGO=3.0 - - python: 3.7 - env: DJANGO=master - - - - python: 3.8 - env: DJANGO=2.2 - - python: 3.8 - env: DJANGO=3.0 - - python: 3.8 - env: DJANGO=master - -install: - - pip install tox tox-travis -script: - - tox -after_success: - - pip install coveralls - - coveralls diff --git a/tox.ini b/tox.ini index 3d786c8..c7694e4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,23 +1,25 @@ [tox] envlist = - {py27,py35,py36}-django111, - {py35,py36,py37,py38}-django22, - {py36,py37,py38}-django{30,master} + {py36,py37,py38,py39,py310}-django22, + {py36,py37,py38,py39,py310}-django32, + {py38,py39,py310}-django{40,master}, + py310-djangomaster [testenv] deps= - django111: Django>=1.11,<2.0 django22: Django>=2.2,<3.0 - django30: Django>=3.0,<4.0 + django32: Django>=3.2,<4.0 + django40: Django>=4.0,<4.1 djangomaster: https://github.com/django/django/archive/main.tar.gz -r requirements.txt coverage commands= coverage run ./runtests.py -[travis:env] -DJANGO = - 1.11: django111 - 2.2: django22 - 3.0: django30 - master: djangomaster +[gh-actions] +python = + 3.6: py36-django{22,32} + 3.7: py37-django{22,32} + 3.8: py38-django{22,32,40} + 3.9: py39-django{22,32,40} + 3.10: py310-django{22,32,40,master}