2020-12-17 16:03:54 +01:00
|
|
|
name: Validate Python e2e
|
2022-12-22 10:17:13 +01:00
|
|
|
|
2022-06-08 14:58:05 +02:00
|
|
|
on:
|
2020-04-29 19:57:02 +02:00
|
|
|
push:
|
2020-05-01 18:52:58 +02:00
|
|
|
branches:
|
2020-07-14 16:04:57 +02:00
|
|
|
- main
|
2020-05-01 18:52:58 +02:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-04-29 19:57:02 +02:00
|
|
|
pull_request:
|
2020-05-01 18:52:58 +02:00
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
2020-04-29 19:57:02 +02:00
|
|
|
schedule:
|
2020-12-17 16:03:54 +01:00
|
|
|
- cron: 30 3 * * *
|
2022-06-02 16:37:57 +02:00
|
|
|
workflow_dispatch:
|
2020-04-29 19:57:02 +02:00
|
|
|
|
|
|
|
jobs:
|
2022-06-02 16:37:57 +02:00
|
|
|
setup-versions-from-manifest:
|
|
|
|
name: Setup ${{ matrix.python }} ${{ matrix.os }}
|
2020-04-29 19:57:02 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-04 16:18:24 +02:00
|
|
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
|
|
|
python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
|
|
|
|
exclude:
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
python: 3.5.4
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
python: 3.6.7
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
python: 3.7.5
|
|
|
|
- os: windows-latest
|
|
|
|
python: 3.8.15
|
2020-04-29 19:57:02 +02:00
|
|
|
steps:
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: setup-python ${{ matrix.python }}
|
|
|
|
id: setup-python
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
- name: Check python-path
|
|
|
|
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Validate version
|
|
|
|
run: |
|
|
|
|
$pythonVersion = (python --version)
|
|
|
|
if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
|
|
|
|
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
$pythonVersion
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Run simple code
|
|
|
|
run: python -c 'import math; print(math.factorial(5))'
|
2020-04-29 19:57:02 +02:00
|
|
|
|
2022-06-02 16:37:57 +02:00
|
|
|
setup-versions-from-file:
|
|
|
|
name: Setup ${{ matrix.python }} ${{ matrix.os }} version file
|
2020-04-29 19:57:02 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-04 16:18:24 +02:00
|
|
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
|
|
|
python: [3.5.4, 3.6.7, 3.7.5, 3.8.15, 3.9.13]
|
|
|
|
exclude:
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
python: 3.5.4
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
python: 3.6.7
|
|
|
|
- os: ubuntu-22.04
|
|
|
|
python: 3.7.5
|
|
|
|
- os: windows-latest
|
|
|
|
python: 3.8.15
|
2020-04-29 19:57:02 +02:00
|
|
|
steps:
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: build-version-file ${{ matrix.python }}
|
|
|
|
run: echo ${{ matrix.python }} > .python-version
|
|
|
|
|
|
|
|
- name: setup-python ${{ matrix.python }}
|
|
|
|
id: setup-python
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version-file: '.python-version'
|
|
|
|
|
|
|
|
- name: Check python-path
|
|
|
|
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Validate version
|
|
|
|
run: |
|
|
|
|
$pythonVersion = (python --version)
|
|
|
|
if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
|
|
|
|
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
$pythonVersion
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Run simple code
|
|
|
|
run: python -c 'import math; print(math.factorial(5))'
|
2020-07-17 11:58:03 +02:00
|
|
|
|
|
|
|
setup-pre-release-version-from-manifest:
|
|
|
|
name: Setup 3.9.0-beta.4 ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-04 16:18:24 +02:00
|
|
|
os: [macos-latest, windows-latest, ubuntu-20.04]
|
2020-07-17 11:58:03 +02:00
|
|
|
steps:
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: setup-python 3.9.0-beta.4
|
|
|
|
id: setup-python
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version: '3.9.0-beta.4'
|
|
|
|
|
|
|
|
- name: Check python-path
|
|
|
|
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Validate version
|
|
|
|
run: |
|
|
|
|
$pythonVersion = (python --version)
|
|
|
|
if ("Python 3.9.0b4" -ne "$pythonVersion"){
|
|
|
|
Write-Host "The current version is $pythonVersion; expected version is 3.9.0b4"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
$pythonVersion
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
- name: Run simple code
|
|
|
|
run: python -c 'import math; print(math.factorial(5))'
|
2020-12-07 22:59:14 +01:00
|
|
|
|
2022-06-08 14:58:05 +02:00
|
|
|
setup-dev-version:
|
|
|
|
name: Setup 3.9-dev ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-06-08 14:58:05 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: setup-python 3.9-dev
|
|
|
|
id: setup-python
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version: '3.9-dev'
|
2022-06-08 14:58:05 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Check python-path
|
|
|
|
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
|
|
shell: bash
|
2022-06-08 14:58:05 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Validate version
|
|
|
|
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.9.') }}
|
|
|
|
shell: bash
|
2022-06-08 14:58:05 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Run simple code
|
|
|
|
run: python -c 'import math; print(math.factorial(5))'
|
2022-06-29 17:00:51 +02:00
|
|
|
|
2023-01-27 22:19:31 +01:00
|
|
|
setup-prerelease-version:
|
|
|
|
name: Setup 3.12 ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
steps:
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2023-01-27 22:19:31 +01:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: setup-python 3.12
|
|
|
|
id: setup-python
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version: '3.12'
|
|
|
|
allow-prereleases: true
|
2023-01-27 22:19:31 +01:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Check python-path
|
|
|
|
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
|
|
|
|
shell: bash
|
2023-01-27 22:19:31 +01:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Validate version
|
|
|
|
run: ${{ startsWith(steps.setup-python.outputs.python-version, '3.12.') }}
|
|
|
|
shell: bash
|
2023-01-27 22:19:31 +01:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Run simple code
|
|
|
|
run: python -c 'import math; print(math.factorial(5))'
|
2023-01-27 22:19:31 +01:00
|
|
|
|
2022-06-29 17:00:51 +02:00
|
|
|
setup-versions-noenv:
|
|
|
|
name: Setup ${{ matrix.python }} ${{ matrix.os }} (noenv)
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-04 16:18:24 +02:00
|
|
|
os: [macos-latest, windows-latest, ubuntu-20.04, ubuntu-22.04]
|
2023-03-09 11:44:56 +01:00
|
|
|
python: ['3.7', '3.8', '3.9', '3.10']
|
2022-06-29 17:00:51 +02:00
|
|
|
steps:
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-06-29 17:00:51 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: setup-python ${{ matrix.python }}
|
|
|
|
id: setup-python
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
update-environment: false
|
2022-06-29 17:00:51 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Python version
|
|
|
|
run: ${{ steps.setup-python.outputs.python-path }} --version
|
2022-06-29 17:00:51 +02:00
|
|
|
|
2023-03-09 11:44:56 +01:00
|
|
|
- name: Run simple code
|
|
|
|
run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))'
|
2022-07-25 16:54:04 +02:00
|
|
|
|
|
|
|
check-latest:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2023-03-09 11:44:56 +01:00
|
|
|
python-version: ['3.8', '3.9', '3.10']
|
2022-07-25 16:54:04 +02:00
|
|
|
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)
|
2022-12-22 13:02:09 +01:00
|
|
|
if ("$pythonVersion" -NotMatch "${{ matrix.python-version }}"){
|
|
|
|
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python-version }}"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
$pythonVersion
|
|
|
|
shell: pwsh
|
|
|
|
|
|
|
|
setup-python-multiple-python-versions:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup Python and check latest
|
|
|
|
uses: ./
|
|
|
|
with:
|
|
|
|
python-version: |
|
2023-03-09 11:44:56 +01:00
|
|
|
3.7
|
|
|
|
3.8
|
|
|
|
3.9
|
|
|
|
3.10
|
2022-12-22 13:02:09 +01:00
|
|
|
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"
|
2022-07-25 16:54:04 +02:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
$pythonVersion
|
2023-01-27 22:19:31 +01:00
|
|
|
shell: pwsh
|
2023-04-11 03:50:38 +02:00
|
|
|
|
|
|
|
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
|