mirror of
https://github.com/actions/setup-python.git
synced 2025-07-04 08:33:47 +00:00
add check-latest for python versions
This commit is contained in:
parent
ae11205ec6
commit
58a8109aea
9 changed files with 2136 additions and 1635 deletions
23
.github/workflows/test-python.yml
vendored
23
.github/workflows/test-python.yml
vendored
|
@ -91,3 +91,26 @@ jobs:
|
|||
- name: Run simple code
|
||||
run: python -c 'import math; print(math.factorial(5))'
|
||||
|
||||
check-latest:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python-version: ["3.8", "3.9", "3.10"]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Setup Python and check latest
|
||||
uses: ./
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
check-latest: true
|
||||
- name: Validate version
|
||||
run: |
|
||||
$pythonVersion = (python --version)
|
||||
if ("$pythonVersion" -NotMatch "${{ matrix.python }}"){
|
||||
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
|
||||
exit 1
|
||||
}
|
||||
$pythonVersion
|
||||
shell: pwsh
|
Loading…
Add table
Add a link
Reference in a new issue