diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a6807a1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +name: CI +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + Build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - python-version: 3.6 + DJANGO: 3.2.14 + - python-version: 3.7 + DJANGO: 3.2.14 + - python-version: 3.8 + DJANGO: 3.2.14 + - python-version: 3.9 + DJANGO: 3.2.14 + - python-version: '3.10' + DJANGO: 3.2.14 + - python-version: 3.8 + DJANGO: 4.0.6 + - python-version: 3.9 + DJANGO: 4.0.6 + - python-version: '3.10' + DJANGO: 4.0.6 + steps: + - name: 'Set up Python ${{ matrix.python-version }}' + uses: actions/setup-python@v2 + with: + python-version: '${{ matrix.python-version }}' + - uses: actions/checkout@v2 + - run: pip install coveralls + - run: pip install -e . + - run: pip install -r tests/requirements.txt + - run: 'pip install Django==${DJANGO}' + env: + DJANGO: '${{ matrix.DJANGO }}' + - run: make test + - run: coveralls diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 369fc7b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,47 +0,0 @@ -language: python -python: - - 2.7 - - 3.4 - - 3.5 - - 3.6 - - 3.7 - - 3.8 -before_install: - - pip install coveralls -install: - - pip install -e . - - pip install -r tests/requirements.txt - - pip install Django==${DJANGO} -script: make test -env: - - DJANGO=1.11.27 - - DJANGO=2.0.13 - - DJANGO=2.1.15 - - DJANGO=2.2.9 - - DJANGO=3.0.2 -matrix: - exclude: - - python: 3.8 - env: DJANGO=1.11.27 - - python: 2.7 - env: DJANGO=2.0.13 - - python: 3.8 - env: DJANGO=2.0.13 - - python: 2.7 - env: DJANGO=2.1.15 - - python: 3.4 - env: DJANGO=2.1.15 - - python: 3.8 - env: DJANGO=2.1.15 - - python: 2.7 - env: DJANGO=2.2.9 - - python: 3.4 - env: DJANGO=2.2.9 - - python: 2.7 - env: DJANGO=3.0.2 - - python: 3.4 - env: DJANGO=3.0.2 - - python: 3.5 - env: DJANGO=3.0.2 -after_success: - - coveralls diff --git a/Makefile b/Makefile index 68d7ba7..93082d5 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,8 @@ export PYTHONPATH=. test: flake8 avatar --ignore=E124,E501,E127,E128,E722 - coverage run --source=avatar `which django-admin.py` test tests + black --check . + coverage run --source=avatar `which django-admin` test tests coverage report publish: clean diff --git a/avatar/models.py b/avatar/models.py index 52cf65c..3d7f353 100644 --- a/avatar/models.py +++ b/avatar/models.py @@ -1,5 +1,4 @@ import binascii -import datetime import os import hashlib import six