Add GitHub Actions test workflow.

This commit is contained in:
Jannis Leidel 2020-11-26 16:18:58 +01:00
parent 3305de960a
commit b540ceadb3
No known key found for this signature in database
GPG key ID: C795956FB489DCA9
2 changed files with 49 additions and 1 deletions

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

@ -0,0 +1,48 @@
name: Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', 'pypy3']
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

@ -11,7 +11,7 @@ envlist =
py{35,36,37,38,py3}-dj22
py{36,37,38,py3}-dj{30,master}
[travis]
[gh-actions]
python =
2.7: py27
3.5: py35