summaryrefslogtreecommitdiff
path: root/.github/workflows/tests.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/tests.yml')
-rw-r--r--.github/workflows/tests.yml63
1 files changed, 63 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000..9ea114e
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,63 @@
+# Generated from:
+# https://github.com/zopefoundation/meta/tree/master/config/pure-python
+name: tests
+
+on:
+ push:
+ pull_request:
+ schedule:
+ - cron: '0 12 * * 0' # run once a week on Sunday
+ # Allow to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+ build:
+ strategy:
+ # We want to see all failures:
+ fail-fast: false
+ matrix:
+ os:
+ - ubuntu
+ config:
+ # [Python version, tox env]
+ - ["3.8", "lint"]
+ - ["2.7", "py27"]
+ - ["3.5", "py35"]
+ - ["3.6", "py36"]
+ - ["3.7", "py37"]
+ - ["3.8", "py38"]
+ - ["3.9", "py39"]
+ - ["pypy2", "pypy"]
+ - ["pypy3", "pypy3"]
+ - ["3.8", "docs"]
+ - ["3.8", "coverage"]
+
+ runs-on: ${{ matrix.os }}-latest
+ name: ${{ matrix.config[1] }}
+ steps:
+ - uses: actions/checkout@v2
+ - name: Set up Python
+ uses: actions/setup-python@v2
+ with:
+ python-version: ${{ matrix.config[0] }}
+ - name: Pip cache
+ uses: actions/cache@v2
+ with:
+ path: ~/.cache/pip
+ key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
+ restore-keys: |
+ ${{ runner.os }}-pip-${{ matrix.config[0] }}-
+ ${{ runner.os }}-pip-
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install tox
+ - name: Test
+ run: tox -e ${{ matrix.config[1] }}
+ - name: Coverage
+ if: matrix.config[1] == 'coverage'
+ run: |
+ pip install coveralls coverage-python-version
+ coveralls --service=github
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}