From bf72a830c23f4d7348643aead2a1895a2da92926 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 23 Nov 2020 14:55:01 +0100 Subject: [PATCH] Add test workflow. --- .github/workflows/test.yml | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f7404c1 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 }}