Try to make GitHub Actions automatically use appropriate Tox envs by using

`tox-gh-actions` package.
This commit is contained in:
Itamar Turner-Trauring 2021-05-05 10:06:35 -04:00
parent 8f997870c8
commit ea2db971a6
2 changed files with 18 additions and 10 deletions

View File

@ -40,17 +40,15 @@ jobs:
- name: Set up Python ${{ matrix.python-version }}
if: ${{ matrix.os != 'windows-latest' }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# See note below about need for using 32-bit Python 2.7 on
# Windows. The extra handling here for Python 3.6 on Windows is
# because I could not figure out the right GitHub Actions
# expression to do this in a better way.
# Windows.
- name: Set up Python ${{ matrix.python-version }} [Windows x64]
if: ${{ ( matrix.os == 'windows-latest' ) && ( matrix.python-version == '3.6' ) }}
uses: actions/setup-python@v1
if: ${{ ( matrix.os == 'windows-latest' ) && ( matrix.python-version != '2.7' ) }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
@ -89,14 +87,14 @@ jobs:
- name: Install Python packages
run: |
pip install --upgrade codecov tox setuptools
pip install --upgrade codecov tox tox-gh-actions setuptools
pip list
- name: Display tool versions
run: python misc/build_helpers/show-tool-versions.py
- name: Run "tox -e py27-coverage"
run: tox -e py27-coverage
- name: Run tox for corresponding Python version
run: python -m tox
- name: Upload eliot.log in case of failure
uses: actions/upload-artifact@v1

12
tox.ini
View File

@ -3,11 +3,21 @@
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
# Map Python versions in GitHub Actions to tox environments to run.
[gh-actions]
python =
2.7: py27-coverage,codechecks
3.6: py36-coverage
3.7: py37-coverage
3.8: py38-coverage
3.9: py39-coverage,typechecks
pypy-3.7: pypy3
[pytest]
twisted = 1
[tox]
envlist = typechecks,codechecks,py27,py36,pypy27
envlist = typechecks,codechecks,py27,py36,py37,py38,py39,pypy27,pypy3
minversion = 2.4
[testenv]