From 2b9e70a16e990a0feb6cfc42919d9e2be73c4924 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 13 Dec 2020 10:31:04 -0500 Subject: [PATCH] GitHub Action to run tests --- .github/workflows/tests.yml | 51 +++++++++++++++++++++++++++++++++++++ README.rst | 8 +++--- tox.ini | 10 ++++++++ 3 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..7a346ad --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,51 @@ +name: "Test Suite" + +on: + push: + branches: ["master"] + pull_request: + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + tests: + name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" + runs-on: "${{ matrix.os }}" + + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: + - "3.5" + #- "3.6" + #- "3.7" + - "3.8" + #- "3.9" + #- "pypy3" + exclude: + # Windows PyPy doesn't seem to work? + - os: windows-latest + python-version: "pypy3" + fail-fast: false + + steps: + - name: "Check out the repo" + uses: "actions/checkout@v2" + + - name: "Set up Python" + uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + + - name: "Install dependencies" + run: | + python -m pip install -U setuptools + python -m pip install -r requirements/travis.txt + python -m pip install -c requirements/constraints.txt tox-gh-actions + + - name: "Run tox for ${{ matrix.python-version }}" + run: | + python -m tox diff --git a/README.rst b/README.rst index da58abe..33b168a 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Scriv ##### -|pypi-badge| |travis-badge| |doc-badge| |pyversions-badge| |license-badge| +|pypi-badge| |ci-badge| |doc-badge| |pyversions-badge| |license-badge| Scriv changelog management tool @@ -52,9 +52,9 @@ Contributions are very welcome. :target: https://pypi.python.org/pypi/scriv/ :alt: PyPI -.. |travis-badge| image:: https://travis-ci.com/nedbat/scriv.svg?branch=master - :target: https://travis-ci.com/github/nedbat/scriv - :alt: Travis +.. |ci-badge| image:: https://github.com/nedbat/scriv/workflows/Test%20Suite/badge.svg + :target: https://github.com/nedbat/scriv/actions?query=workflow%3A%22Test+Suite%22 + :alt: Build status .. |doc-badge| image:: https://readthedocs.org/projects/scriv/badge/?version=latest :target: http://scriv.readthedocs.io/en/latest/ diff --git a/tox.ini b/tox.ini index fcaf2a9..c3aa335 100644 --- a/tox.ini +++ b/tox.ini @@ -44,3 +44,13 @@ commands = isort --check-only --diff -p scriv tests src/scriv setup.py python setup.py -q sdist twine check dist/* + +[gh-actions] +python = + 3.5: py35 + 3.6: py36 + 3.7: py37 + 3.8: py38, quality, docs + 3.9: py39 + pypy: pypy + pypy3: pypy3