-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #298 from adamchainz/python_3.10
Fix tests, test Python 3.10, and run on tests on GitHub Actions
- Loading branch information
Showing
7 changed files
with
90 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
name: Python ${{ matrix.python-version }} | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
python-version: | ||
- 2.7 | ||
- 3.7 | ||
- 3.8 | ||
- 3.9 | ||
- '3.10' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --upgrade tox | ||
- name: Run tox targets for ${{ matrix.python-version }} | ||
run: | | ||
ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") | ||
TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage-data | ||
path: '.coverage.*' | ||
|
||
coverage: | ||
name: Coverage | ||
runs-on: ubuntu-20.04 | ||
needs: tests | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: python -m pip install --upgrade coverage[toml] | ||
|
||
- name: Download data | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: coverage-data | ||
|
||
- name: Combine coverage and fail if it's <100% | ||
run: | | ||
python -m coverage combine | ||
python -m coverage html --skip-covered --skip-empty | ||
python -m coverage report --fail-under=55 | ||
- name: Upload HTML report | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: html-report | ||
path: htmlcov |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,20 @@ | ||
[tox] | ||
# These should match the travis env list | ||
envlist = py27,py36,py37,pypy | ||
# These should match the GitHub Actions env list | ||
envlist = py27,py37,py38,py39,py310 | ||
|
||
[testenv] | ||
install_command = pip install {opts} {packages} | ||
deps = -rrequirements-dev.txt | ||
setenv = | ||
LANG=en_US.UTF-8 | ||
commands = | ||
coverage erase | ||
coverage run -p -m pytest {posargs:tests} | ||
# Needed because we subprocess to ourselves | ||
coverage combine | ||
coverage report --show-missing --fail-under 55 # TODO: 100 | ||
flake8 --extend-ignore=E127 nodeenv.py tests setup.py | ||
|
||
[testenv:venv] | ||
envdir = venv-nodeenv | ||
commands = | ||
|
||
[testenv:docs] | ||
deps = | ||
{[testenv]deps} | ||
sphinx | ||
changedir = docs | ||
commands = sphinx-build -b html -d build/doctrees source build/html | ||
|
||
[pytest] | ||
markers = | ||
integration: tests that take a little bit longer |