Replaced travis with GH Actions

This commit is contained in:
Jules Lasne 2020-11-26 14:31:41 +01:00
parent a09cc0e115
commit 4e8cd269f7
3 changed files with 37 additions and 29 deletions

30
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Tox tests
on:
push:
branches:
- '*.*'
pull_request:
branches:
- '*.*'
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v1
- 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

View File

@ -1,29 +0,0 @@
language: python
cache:
directories:
- .tox/
- $HOME/.cache/pip
matrix:
include:
- python: "3.6"
env: TOX_ENV=py36
name: 3.6 tests
- python: "3.7"
env: TOX_ENV=py37
name: 3.7 tests
- python: "3.8"
env: TOX_ENV=py38
name: 3.8 tests
# 3.9 is commented as travis doesn't have it as of October 2020
# - python: "3.9"
# env: TOX_ENV=py39
# name: 3.9 tests
- python: "3.8"
env: TOX_ENV=black,flake8,mypy
name: Linting
install:
- pip uninstall -y virtualenv
- pip install tox
script:
- tox -r -e $TOX_ENV

View File

@ -5,6 +5,13 @@ extend-ignore = E501 # line length handled by black.
envlist = py36, py37, py38, py39, flake8, mypy, black
skip_missing_interpreters = True
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38, mypy, flake8, black
3.9: py39, mypy, flake8, black
[testenv]
deps =
pytest