From dec4f3c89f03071f3bd494f0245e601ad4e5e398 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Mon, 6 Jul 2020 02:28:00 +0100 Subject: [PATCH] Use Github Actions for testing --- .github/workflows/test.yml | 22 +++++++++++++++++++++ tox.ini | 39 +++++++++++++++++++++++--------------- 2 files changed, 46 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..49b67a3c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Run tests + +on: [push, pull_request] + +jobs: + test-latest: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + 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@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install tox + run: python -m pip install --upgrade pip tox + - name: Run Tests + run: tox -e py,install,docs diff --git a/tox.ini b/tox.ini index 3638f82c..91eacd46 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # install tox" and then run "tox" from this directory. [tox] -envlist = {py35,py36,py37,py38}-{tests,install},py36-docs +envlist = {py35,py36,py37,py38}-{tests,install},docs,install,py36-docs [testenv] download = true @@ -20,34 +20,43 @@ deps = -rrequirements/runtime.txt -rrequirements/tests.txt -[testenv:py37-install] +[testenv:install] skip_install = True commands = python setup.py bdist_wheel pip install --no-index --find-links=dist pydocstyle pydocstyle --help +[testenv:docs] +changedir = docs +deps = + -rrequirements/runtime.txt + -rrequirements/docs.txt +commands = sphinx-build -b html . _build + +[testenv:py36-docs] +changedir = {[testenv:docs]changedir} +deps = {[testenv:docs]deps} +commands = {[testenv:docs]commands} + # There's no way to generate sub-sections in tox. # The following sections are all references to the `py37-install`. [testenv:py35-install] -skip_install = {[testenv:py37-install]skip_install} -commands = {[testenv:py37-install]commands} +skip_install = {[testenv:install]skip_install} +commands = {[testenv:install]commands} [testenv:py36-install] -skip_install = {[testenv:py37-install]skip_install} -commands = {[testenv:py37-install]commands} +skip_install = {[testenv:install]skip_install} +commands = {[testenv:install]commands} -[testenv:py38-install] -skip_install = {[testenv:py37-install]skip_install} -commands = {[testenv:py37-install]commands} +[testenv:py37-install] +skip_install = {[testenv:install]skip_install} +commands = {[testenv:install]commands} -[testenv:py36-docs] -changedir=docs -deps = - -rrequirements/runtime.txt - -rrequirements/docs.txt -commands=sphinx-build -b html . _build +[testenv:py38-install] +skip_install = {[testenv:install]skip_install} +commands = {[testenv:install]commands} [pytest] pep8ignore =