Skip to content

Commit

Permalink
Add GitHub Actions for matrix of Pythons and OSes, coverage, docs, an… (
Browse files Browse the repository at this point in the history
#492)

* Add GitHub Actions for matrix of Pythons and OSes, coverage, docs, lint, and functional3 tests
* Remove travis
* Bump coverage, docs, lint from 3.6 to 3.8
* Bump base Python from 3.6 to 3.8
* Move pyramid into proper dependency extra
* Python 3.5 is EOL, remove support. Add 3.9 support.

Co-authored-by: Sydo Luciani <[email protected]>
  • Loading branch information
stevepiercy and sydoluciani authored Nov 9, 2020
1 parent 622ed45 commit 7ada53d
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 74 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build and test

on:
# Build only on pushes to master or one of the release branches
push:
branches:
- master
- "[0-9].[0-9]+-branch"
tags:
# Build pull requests
pull_request:

jobs:
test:
strategy:
matrix:
py:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy3"
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-latest"
architecture:
- x64
- x86
include:
# Only run coverage on ubuntu-latest, except on pypy3
- os: "ubuntu-latest"
nosetests-args: "--with-xunit"
- os: "ubuntu-latest"
py: "pypy3"
nosetests-args: ""
exclude:
# Linux and macOS don't have x86 python
- os: "ubuntu-latest"
architecture: x86
- os: "macos-latest"
architecture: x86
# PyPy3 on Windows doesn't seem to work
- os: "windows-latest"
py: "pypy3"
name: "Python: ${{ matrix.py }}-${{ matrix.architecture }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.architecture }}
- run: pip install tox
- name: Running tox
run: tox -e py -- ${{ matrix.nosetests-args }}
functional3:
runs-on: ubuntu-latest
name: Functional web tests
env:
DISPLAY: ":99"
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: x64
- name: Install requirements
run: |
sudo apt-get update
sudo apt-get install firefox firefox-geckodriver gettext gettext-base xvfb
pip install tox
- name: Run functional web tests
run: |
Xvfb :99 &
tox -e functional3
coverage:
runs-on: ubuntu-latest
name: Validate coverage
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: x64
- run: |
pip install tox
tox -e py39-cover,coverage
docs:
runs-on: ubuntu-latest
name: Build the documentation
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: x64
- run: |
pip install tox
tox -e docs
lint:
runs-on: ubuntu-latest
name: Lint the package
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: x64
- run: |
pip install tox
tox -e lint
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ def readfile(name):
"readme_renderer",
]

testing_extras = ["beautifulsoup4", "coverage", "flaky", "nose"]
testing_extras = ["beautifulsoup4", "coverage", "flaky", "nose", "pyramid"]

# Needed to run deformdemo tests
functional_testing_extras = [
"selenium>=3",
"pyramid",
"pygments",
"waitress",
"lingua",
Expand Down Expand Up @@ -78,10 +77,10 @@ def readfile(name):
"License :: Repoze Public License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
],
Expand Down
30 changes: 8 additions & 22 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,45 +1,35 @@
[tox]
envlist =
lint,docs,
py35,py36,py37,py38,pypy3,
py3-cover,coverage,
py36,py37,py38,py39,pypy3,
py39-cover,coverage,
functional3

[testenv]
# Most of these are defaults but if you specify any you can't fall back
# to defaults for others.
basepython =
py35: python3.5
py36: python3.6
py37: python3.7
py38: python3.8
pypy3: pypy3
py3: python3.6
deps = pyramid
usedevelop = true
extras =
testing
setenv =
COVERAGE_FILE=.coverage.{envname}
commands =
python --version
pip install deform[testing]
nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:}

# we separate coverage into its own testenv because a) "last run wins" wrt
# cobertura jenkins reporting and b) pypy and jython can't handle any
# combination of versions of coverage and nosexcover that i can find.

[py-cover]
commands =
pip install deform[testing]
coverage run --source=deform --omit=deform/[a-z]*_[a-z0-9]*.py {envbindir}/nosetests
coverage xml -o {envname}.xml -i

[testenv:py3-cover]
[testenv:py39-cover]
commands =
{[py-cover]commands}
setenv =
COVERAGE_FILE=.coverage.py3

[testenv:lint]
basepython = python3.6
commands =
flake8 deform setup.py
isort --check-only --df deform setup.py
Expand All @@ -50,7 +40,6 @@ extras =
lint

[testenv:coverage]
basepython = python3.6
commands =
coverage erase
coverage combine
Expand All @@ -60,9 +49,9 @@ deps =
coverage
setenv =
COVERAGE_FILE=.coverage
depends = py39-cover

[testenv:docs]
basepython = python3.6
whitelist_externals = make
commands =
pip install deform[docs]
Expand All @@ -73,7 +62,6 @@ commands =
[testenv:functional3]
# Allow override test browser
passenv = DISPLAY WEBDRIVER FIREFOX_PATH TRAVIS URL WAITTOSTART CONTAINERTZ
basepython = python3.6
commands =
pip install deform[testing,functional]
./run-selenium-tests.bash --with-flaky --max-runs=4 {posargs}
Expand All @@ -83,7 +71,6 @@ deps =

[testenv:format]
skip_install = true
basepython = python3.8
commands =
isort deform setup.py
black deform setup.py
Expand All @@ -94,7 +81,6 @@ deps =

[testenv:build]
skip_install = true
basepython = python3.8
commands =
# clean up build/ and dist/ folders
python -c 'import shutil; shutil.rmtree("dist", ignore_errors=True)'
Expand Down

0 comments on commit 7ada53d

Please sign in to comment.