X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=.github%2Fworkflows%2Frun-tests.yaml;h=7577e272adbbb68f3fbfc3245a412420f9fb88a7;hb=a652a0e72fbc7a5d4ca2233a28adf28eb76ea72b;hp=b62756aaa383a89d0b5d6defad0fe7a3cd7221b9;hpb=f318f42ea249207548900c4c4c3d9b1eff650ce0;p=mimedecode.git diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index b62756a..7577e27 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -4,10 +4,12 @@ on: [push, pull_request] jobs: run-tests: + env: + not_in_conda: "['3.11', 'pypy-3.7']" strategy: matrix: - python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-2.7", "pypy-3.7"] + python-version: ["2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.7"] name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest @@ -16,9 +18,14 @@ jobs: # Setup Python/pip - uses: actions/checkout@v2 + - uses: s-weigand/setup-conda@v1 + with: + python-version: ${{ matrix.python-version }} + if: ${{ runner.os == 'Linux' && !contains(fromJSON(env.not_in_conda), matrix.python-version) }} - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + if: ${{ runner.os != 'Linux' || contains(fromJSON(env.not_in_conda), matrix.python-version) }} - name: Cache pip uses: actions/cache@v3 with: @@ -32,9 +39,22 @@ jobs: python --version python -m pip install --upgrade pip setuptools wheel pip --version - pip install --upgrade virtualenv tox tox-gh-actions + pip install --upgrade virtualenv tox + - name: Set TOXENV + run: | + import os, sys + if hasattr(sys, 'pypy_version_info'): + toxenv = 'pypy3' + else: + pyver = '%d%d' % tuple(sys.version_info[:2]) + toxenv = 'py%s' % pyver + with open(os.environ['GITHUB_ENV'], 'a') as f: + f.write('TOXENV=' + toxenv + '\n') + shell: python + - name: Run tox targets for ${{ matrix.python-version }} run: | + python -c "import os; print(os.environ['TOXENV'])" tox --version tox