diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2dcc911f..688f105b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,13 @@ jobs: os: ubuntu-latest toxenv: lint + env: + # Set TOXENV env var to tell tox which testenv (see tox.ini) to use + # NOTE: The Python 2.7 runner has two Python versions on the path (see + # setup-python below), so we tell tox explicitly to use the 'py27' + # testenv. For all other runners the toxenv configured above suffices. + TOXENV: ${{ matrix.python-version == '2.7' && 'py27' || matrix.toxenv }} + runs-on: ${{ matrix.os }} steps: @@ -33,6 +40,12 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Set up service Python 3.x (on 2.7 only) + uses: actions/setup-python@v2 + if: ${{ matrix.python-version == 2.7 }} + with: + python-version: 3.x + - name: Find pip cache dir id: pip-cache run: echo "::set-output name=dir::$(pip cache dir)" @@ -52,8 +65,9 @@ jobs: python -m pip install --upgrade pip pip install --upgrade tox coveralls - - name: Run tox - run: tox -e ${{ matrix.toxenv }} + - name: Run tox (${{ env.TOXENV }}) + # See TOXENV environment variable for the testenv to be executed here + run: tox - name: Publish on coveralls.io # TODO: Maybe make 'lint' a separate job instead of case handling here diff --git a/tox.ini b/tox.ini index a86fba4f..acf80441 100644 --- a/tox.ini +++ b/tox.ini @@ -14,6 +14,7 @@ skipsdist = true changedir = tests commands = + python --version coverage run aggregate_tests.py coverage report -m --fail-under 97