Allow override of Python version

This commit is contained in:
Luke Tainton 2024-11-28 21:29:24 +00:00
parent c33cffb869
commit 22836419d3
No known key found for this signature in database
4 changed files with 46 additions and 6 deletions

View File

@ -1,6 +1,11 @@
name: Python + Docker CI name: Python w/ Poetry + Docker CI
on: on:
workflow_call: workflow_call:
inputs:
python_version:
type: string
default: "3.11"
description: "Version of Python to use for testing environment"
secrets: secrets:
SONAR_TOKEN: SONAR_TOKEN:
required: true required: true
@ -11,6 +16,11 @@ jobs:
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set python_version
id: python_version
run: |
PYTHON_VERSION=${{ github.event.inputs.python_version }}
echo "::set-output name=value::${PYTHON_VERSION:-"3.11"}"
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
with: with:
@ -24,7 +34,7 @@ jobs:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.11" python-version: "${{ steps.python_version.outputs.value }}"
- name: Setup Poetry - name: Setup Poetry
uses: abatilo/actions-poetry@v3 uses: abatilo/actions-poetry@v3
- name: Install dependencies - name: Install dependencies

View File

@ -1,6 +1,11 @@
name: Python CI name: Python w/ Poetry CI
on: on:
workflow_call: workflow_call:
inputs:
python_version:
type: string
default: "3.11"
description: "Version of Python to use for testing environment"
secrets: secrets:
SONAR_TOKEN: SONAR_TOKEN:
required: true required: true
@ -11,6 +16,11 @@ jobs:
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set python_version
id: python_version
run: |
PYTHON_VERSION=${{ github.event.inputs.python_version }}
echo "::set-output name=value::${PYTHON_VERSION:-"3.11"}"
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
with: with:
@ -18,7 +28,7 @@ jobs:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.11" python-version: "${{ steps.python_version.outputs.value }}"
- name: Setup Poetry - name: Setup Poetry
uses: abatilo/actions-poetry@v3 uses: abatilo/actions-poetry@v3
- name: Install dependencies - name: Install dependencies

View File

@ -1,6 +1,11 @@
name: Python + Docker CI name: Python + Docker CI
on: on:
workflow_call: workflow_call:
inputs:
python_version:
type: string
default: "3.11"
description: "Version of Python to use for testing environment"
secrets: secrets:
SONAR_TOKEN: SONAR_TOKEN:
required: true required: true
@ -11,6 +16,11 @@ jobs:
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set python_version
id: python_version
run: |
PYTHON_VERSION=${{ github.event.inputs.python_version }}
echo "::set-output name=value::${PYTHON_VERSION:-"3.11"}"
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
with: with:
@ -24,7 +34,7 @@ jobs:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.11" python-version: "${{ steps.python_version.outputs.value }}"
- name: Update Pip - name: Update Pip
run: | run: |
pip install -U pip pip install -U pip

View File

@ -1,6 +1,11 @@
name: Python CI name: Python CI
on: on:
workflow_call: workflow_call:
inputs:
python_version:
type: string
default: "3.11"
description: "Version of Python to use for testing environment"
secrets: secrets:
SONAR_TOKEN: SONAR_TOKEN:
required: true required: true
@ -11,6 +16,11 @@ jobs:
ci: ci:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set python_version
id: python_version
run: |
PYTHON_VERSION=${{ github.event.inputs.python_version }}
echo "::set-output name=value::${PYTHON_VERSION:-"3.11"}"
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4.1.7 uses: actions/checkout@v4.1.7
with: with:
@ -18,7 +28,7 @@ jobs:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.11" python-version: "${{ steps.python_version.outputs.value }}"
- name: Update Pip - name: Update Pip
run: | run: |
pip install -U pip pip install -U pip