diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a6d96b..f98502c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,19 +11,12 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["pypy-2.7", "pypy-3.8", "2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + os: ["ubuntu-22.04", "macos-13", "windows-2022"] + pypy: [0, 1] include: - # Add new helper variables to existing jobs - - {python-version: "pypy-2.7", toxenv: "pypy"} - - {python-version: "pypy-3.8", toxenv: "pypy3"} - - {python-version: "2.7", toxenv: "py27"} - - {python-version: "3.7", toxenv: "py37"} - - {python-version: "3.8", toxenv: "py38"} - - {python-version: "3.9", toxenv: "py39"} - - {python-version: "3.10", toxenv: "py310"} - - {python-version: "3.11", toxenv: "py311"} - - {python-version: "3.12", toxenv: "py312"} + - {os: "ubuntu-20.04", python-version: "2.7"} + - {os: "ubuntu-20.04", python-version: "3.7"} steps: - uses: actions/checkout@v3 @@ -36,22 +29,25 @@ jobs: - name: Get pip cache dir id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" + run: echo "::set-output name=dir::$(pip cache dir)" - name: Cache uses: actions/cache@v3 with: path: ${{ steps.pip-cache.outputs.dir }} key: - ${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/tox.ini') }} + "${{ matrix.os }}-${{ matrix.python-version }}-v1-${{ hashFiles('**/tox.ini') }}" restore-keys: | - ${{ matrix.os }}-${{ matrix.python-version }}-v1- + "${{ matrix.os }}-${{ matrix.python-version }}-v1-" - - name: Install dependencies + - name: Install dependencies & py Env run: | python -m pip install tox + # determine the tox environment to run from python version + python -c 'print("TOX_ENV=py" + "${{ matrix.python-version }}".replace(".", ""))' >> $GITHUB_OUTPUT + - name: Set Pypy env + if: matrix.pypy == 1 + run: python -c 'print("TOX_ENV=pypy" + "${{ matrix.python-version }}"[0])' >> $GITHUB_OUTPUT - name: Tox tests - run: | - tox -e ${{ matrix.toxenv }} + run: tox -e ${{ env.TOX_ENV }} diff --git a/tox.ini b/tox.ini index 03d211a..2c3049f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] isolated_build = true -envlist = py{27, 37, 38, 39, 310, 311, 312, py, py3} +envlist = py{27, 37, 38, 39, 310, 311, 312, py2, py3} [testenv] deps =