Initial GitHub Actions test workflow.

This commit is contained in:
Jannis Leidel 2020-11-25 20:18:19 +01:00
parent c59a19f336
commit 65c7f21730
No known key found for this signature in database
GPG key ID: C795956FB489DCA9
2 changed files with 54 additions and 1 deletions

47
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: [3.5, 3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
-${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Tox tests
run: |
tox -v
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}

View file

@ -6,11 +6,17 @@ exclude = migrations/*,docs/*
[tox]
envlist =
py35-{2.2,3.0},
py35-{2.2},
py36-{2.2,3.0,3.1},
py37-{2.2,3.0,3.1,master},
py38-{2.2,3.0,3.1,master},
[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38
[testenv]
commands =