add check-latest for python versions

This commit is contained in:
Dmitry Shibanov 2022-05-04 11:40:08 +02:00
parent ae11205ec6
commit 58a8109aea
9 changed files with 2136 additions and 1635 deletions

View file

@ -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