mirror of
https://github.com/actions/python-versions.git
synced 2025-12-13 05:56:49 +00:00
Add a new workflow to test Python versions
This commit is contained in:
34
.github/workflows/test-python-version.yml
vendored
Normal file
34
.github/workflows/test-python-version.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Test Python version
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Python version to build'
|
||||||
|
required: true
|
||||||
|
architecture:
|
||||||
|
description: 'The target architecture (x86, x64) of the Python'
|
||||||
|
required: false
|
||||||
|
default: 'x64'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test-python:
|
||||||
|
name: Test Python ${{ github.event.inputs.version }} ${{ matrix.os }}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
||||||
|
steps:
|
||||||
|
- name: Setup Python ${{ github.event.inputs.version }}
|
||||||
|
uses: actions/setup-python@main
|
||||||
|
with:
|
||||||
|
python-version: ${{ github.event.inputs.version }}
|
||||||
|
architecture: ${{ github.event.inputs.architecture }}
|
||||||
|
|
||||||
|
- name: Validate version
|
||||||
|
run: |
|
||||||
|
python --version
|
||||||
|
shell: pwsh
|
||||||
|
|
||||||
|
- name: Run simple code
|
||||||
|
run: python -c 'import math; print(math.factorial(5))'
|
||||||
Reference in New Issue
Block a user