Skip to content

Commit 5dc4efc

Browse files
authored
Merge pull request #135 from pytest-dev/altendky-patch-3
2 parents 5ddc113 + 86f98e2 commit 5dc4efc

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,19 @@ jobs:
138138
- name: Enable Problem Matchers
139139
run: |
140140
echo "::add-matcher::.github/local-problem-matchers.json"
141-
- name: Set up ${{ matrix.python.name }} (if CPython)
142-
if: ${{ job.container == '' && matrix.python.implementation == 'cpython'}}
141+
- name: Set up ${{ matrix.python.name }}
142+
if: ${{ job.container == '' }}
143143
uses: actions/setup-python@v2
144144
with:
145-
python-version: '${{ matrix.python.action }}.0-alpha - ${{ matrix.python.action }}.X'
146-
architecture: x64
147-
- name: Set up ${{ matrix.python.name }} (if PyPy)
148-
if: ${{ job.container == '' && matrix.python.implementation == 'pypy'}}
149-
uses: actions/setup-python@v2
150-
with:
151-
python-version: '${{ matrix.python.action }}'
145+
# This allows the matrix to specify just the major.minor version while still
146+
# expanding it to get the latest patch version including alpha releases.
147+
# This avoids the need to update for each new alpha, beta, release candidate,
148+
# and then finally an actual release version. actions/setup-python doesn't
149+
# support this for PyPy presently so we get no help there.
150+
#
151+
# CPython -> 3.9.0-alpha - 3.9.X
152+
# PyPy -> pypy-3.7
153+
python-version: ${{ fromJSON(format('["{0}", "{1}"]', format('{0}.0-alpha - {0}.X', matrix.python.action), matrix.python.action))[startsWith(matrix.python.action, 'pypy')] }}
152154
architecture: x64
153155
- name: Report Python information
154156
shell: bash

0 commit comments

Comments
 (0)