Skip to content

Commit

Permalink
Setup GHA. (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Nov 20, 2020
1 parent ebe6158 commit 1ac9fe9
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 44 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/tests.yml
@@ -0,0 +1,56 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
name: tests

on:
push:
branches: [ master ]
pull_request:
schedule:
- cron: '0 12 * * 0' # run once a week on Sunday

jobs:
build:
strategy:
matrix:
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", "coverage"]

runs-on: ubuntu-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-${{ hashFiles('setup.*', 'tox.ini') }}
restore-keys: |
${{ 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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 0 additions & 1 deletion .gitignore
Expand Up @@ -22,4 +22,3 @@ lib/
lib64
parts/
pyvenv.cfg
.eggs
5 changes: 3 additions & 2 deletions .meta.cfg
Expand Up @@ -2,6 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = pure-python
commit-id = 91d69dd6c3d1eb67b7382ad48ebbfbc562c4f853
fail-under = 0
commit-id = 1f1620d8f96c3f3781d1df0c591dd72a3f068879
fail-under = 92
with-pypy = True

35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions MANIFEST.in
Expand Up @@ -4,15 +4,17 @@ include *.rst
include *.txt
include buildout.cfg
include tox.ini

exclude MANIFEST.in
include .coveragerc

recursive-include docs *.bat
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
recursive-include docs Makefile

recursive-include src *.gif
recursive-include src *.pt
recursive-include src *.py
recursive-include src *.rst
recursive-include src *.txt
recursive-include src *.xml
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Expand Up @@ -10,4 +10,3 @@ doctests = 1
ignore =
.editorconfig
.meta.cfg
.travis.yml
9 changes: 6 additions & 3 deletions tox.ini
Expand Up @@ -4,12 +4,12 @@
envlist =
lint,
py27,
pypy,
py35,
py36,
py37,
py38,
py39,
pypy,
pypy3,
coverage

Expand All @@ -31,7 +31,7 @@ deps =
commands =
flake8 src setup.py
check-manifest
check-python-versions .
check-python-versions

[testenv:coverage]
basepython = python3
Expand All @@ -42,7 +42,7 @@ deps =
commands =
coverage run -m zope.testrunner --test-path=src []
coverage html
coverage report -m --fail-under=0
coverage report -m --fail-under=92

[coverage:run]
branch = True
Expand All @@ -52,10 +52,13 @@ source = src
[coverage:report]
precision = 2
exclude_lines =
pragma: no cover
pragma: nocover
except ImportError:
raise NotImplementedError
if __name__ == '__main__':
self.fail
raise AssertionError

[coverage:html]
directory = htmlcov

0 comments on commit 1ac9fe9

Please sign in to comment.