Multiple Python versions from version-file in one environment

This makes the change from #567 also available for users of
.python-version.
This commit is contained in:
Victor Westerhuis 2023-04-11 03:50:38 +02:00
parent 7a4f344e33
commit d59aa9efa4
No known key found for this signature in database
3 changed files with 49 additions and 12 deletions

View file

@ -271,3 +271,29 @@ jobs:
}
$pythonVersion
shell: pwsh
setup-python-multiple-python-versions-from-file:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- name: Build multi-version file
run: printf '%s\n' 3.7 3.8 3.9 3.10 > .python-version
shell: bash
- name: Setup Python and check latest
uses: ./
with:
python-version-file: '.python-version'
check-latest: true
- name: Validate version
run: |
$pythonVersion = (python --version)
if ("$pythonVersion" -NotMatch "3.10"){
Write-Host "The current version is $pythonVersion; expected version is 3.10"
exit 1
}
$pythonVersion
shell: pwsh