diff options
-rw-r--r-- | .github/workflows/python-tests.yml | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a9bc859a..ed82aebb 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -34,6 +34,9 @@ jobs: # Pre-release versions (GH-shipped) - os: ubuntu-20.04 python-version: 3.9.0-beta.4 - 3.9.0 + # Pre-release versions (deadsnakes) + - os: ubuntu-20.04 + python-version: 3.9-beta # Dev versions (deadsnakes) - os: ubuntu-20.04 python-version: 3.9-dev @@ -42,21 +45,34 @@ jobs: env: NETWORK_REQUIRED: 1 + PYTHON_VERSION: ${{ matrix.python-version }} TOX_PARALLEL_NO_SPINNER: 1 TOXENV: python + USE_DEADSNAKES: false steps: - uses: actions/checkout@master - - name: Set up Python ${{ matrix.python-version }} (deadsnakes) + - name: Set flag to use deadsnakes + if: >- + endsWith(env.PYTHON_VERSION, '-beta') || + endsWith(env.PYTHON_VERSION, '-dev') + run: | + from __future__ import print_function + python_version = '${{ env.PYTHON_VERSION }}'.replace('-beta', '') + print('::set-env name=PYTHON_VERSION::{ver}'.format(ver=python_version)) + print('::set-env name=USE_DEADSNAKES::true') + shell: python + - name: Set up Python ${{ env.PYTHON_VERSION }} (deadsnakes) uses: deadsnakes/action@v1.0.0 - if: endsWith(matrix.python-version, '-dev') + if: fromJSON(env.USE_DEADSNAKES) && true || false with: - python-version: ${{ matrix.python-version }} - - name: Set up Python ${{ matrix.python-version }} + python-version: ${{ env.PYTHON_VERSION }} + - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@v2 - if: "!endsWith(matrix.python-version, '-dev')" + if: >- + !fromJSON(env.USE_DEADSNAKES) && true || false with: - python-version: ${{ matrix.python-version }} + python-version: ${{ env.PYTHON_VERSION }} - name: Log Python version run: >- python --version @@ -88,9 +104,9 @@ jobs: run: >- python -m pip freeze --all - name: Adjust TOXENV for PyPy - if: startsWith(matrix.python-version, 'pypy') + if: startsWith(env.PYTHON_VERSION, 'pypy') run: >- - echo "::set-env name=TOXENV::${{ matrix.python-version }}" + echo "::set-env name=TOXENV::${{ env.PYTHON_VERSION }}" - name: Log env vars run: >- env |