Add test workflow.

This commit is contained in:
Jannis Leidel 2020-11-23 14:55:01 +01:00
parent 603052bd0c
commit bf72a830c2
No known key found for this signature in database
GPG key ID: C795956FB489DCA9

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

@ -0,0 +1,49 @@
name: Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8, 'pypy2', '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:
test-${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}
restore-keys: |
test-${{ 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
shell: bash
run: |
tox
env:
TARGET: ${{ matrix.target }}
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.COVERALLS_GITHUB_TOKEN }}