diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bfd1086..5059ac8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,37 +8,70 @@ on: jobs: tests: - name: Python ${{ matrix.python-version }} (${{ matrix.runner }}) - runs-on: ${{ matrix.runner }} + name: Python ${{ matrix.python }} ${{ matrix.os }} + runs-on: ${{ matrix.os || 'ubuntu-latest' }} strategy: fail-fast: false matrix: - runner: [ubuntu-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", pypy-2.7, pypy-3.7] + python: ["3.8", "3.9", "3.10", "3.11", "3.12", pypy3.8, pypy3.10] include: - - python-version: "2.7" - runner: ubuntu-20.04 - - python-version: "3.6" - runner: ubuntu-20.04 + - {python: "3.6", os: ubuntu-20.04, tox3: true} + - {python: "3.7", tox3: true} + - {python: pypy2.7, tox3: true} steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 + id: setup-python with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies + python-version: ${{ matrix.python }} + + - run: python -m pip install --upgrade pip setuptools + - name: Install tox4 + run: pip install tox + if: ${{ ! matrix.tox3 }} + - name: Install tox3 + run: pip install 'tox<4' 'virtualenv<20.22.0' + if: ${{ matrix.tox3 }} + + - name: Compute tox env name run: | - python -m pip install --upgrade pip setuptools - pip install tox tox-gh-actions + toxenv=$(python -c ' + ver=r"${{ matrix.python }}".replace(".", "") + print("py" + ver if ver[0].isdigit() else ver) + ') + echo toxenv is "$toxenv"; + echo "TOXENV=$toxenv" >> "$GITHUB_ENV" + - name: Test with tox run: tox + + - uses: actions/upload-artifact@v3 + with: + name: coverage-data + path: .coverage.* + + test-py27: + name: Python 2.7 + runs-on: ubuntu-latest + container: python:2.7-buster + + steps: + - uses: actions/checkout@v3 + - run: python -m pip install --upgrade pip setuptools + - name: Install tox3 + run: pip install 'tox<4' 'virtualenv<20.22.0' + + - name: Test with tox + run: tox -e py27 + - uses: actions/upload-artifact@v3 with: name: coverage-data path: .coverage.* coverage: - needs: tests + needs: [tests, test-py27] if: ${{ success() || failure() }} runs-on: ubuntu-latest steps: diff --git a/tox.ini b/tox.ini index 32658ec..3d0d855 100644 --- a/tox.ini +++ b/tox.ini @@ -10,20 +10,6 @@ envlist = labels = eol = eol_py{27,36,37,py27} -[gh-actions] -python = - 2.7: py27 - 3.6: py36 - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - 3.12: py312 - pypy-2.7: pypy27 - pypy-3.8: pypy38 - pypy-3.10: pypy310 - [testenv] deps = coverage[toml]