Use tox to run the test suite in CI for isolation

Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
This commit is contained in:
Bernat Gabor 2020-09-21 13:53:53 +01:00
parent 785cd4e828
commit 8a7df56112
No known key found for this signature in database
GPG Key ID: 9A12C876AC23ED79
3 changed files with 19 additions and 15 deletions

View File

@ -25,16 +25,26 @@ jobs:
- pypy3
- pypy2
steps:
- name: Setup graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Setup python for tox
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install tox
run: python -m pip install tox
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py }}
- uses: actions/checkout@v2
- name: Setup graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install dev requirements
run: pip install -r dev-requirements.txt
- name: Install project
run: pip install .[graphviz]
- name: Pick tox environment to run
run: |
import subprocess; import json
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True))
print('::set-env name=TOXENV::' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else ("3" if major == 3 else "")))
shell: python
- name: Setup test suite
run: tox -vv --notest
- name: Run test suite
run: pytest -v tests
run: tox --skip-pkg-install

View File

@ -1,8 +0,0 @@
flake8
graphviz
pip>=8.0.2
pytest
pytest-cov
tox>=3
virtualenv>=20,<21
mock;python_version<"3"

View File

@ -22,3 +22,5 @@ deps =
pytest-cov
virtualenv>=20,<21
mock;python_version<"3"
extras =
graphviz