Skip to content

Commit

Permalink
Initial GitHub Actions test workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jezdez committed Nov 25, 2020
1 parent c59a19f commit 65c7f21
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 }}
8 changes: 7 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 65c7f21

Please sign in to comment.