Skip to content

Commit e00a17b

Browse files
Pijukatelvdusek
andauthored
chore: Add python-version as parameter for python workflows (#187)
* Add python version as parameter for python workflows * Apply suggestions from code review Co-authored-by: Vlada Dusek <[email protected]> --------- Co-authored-by: Vlada Dusek <[email protected]>
1 parent c8532a9 commit e00a17b

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/python_lint_check.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ name: Lint check
22

33
on:
44
workflow_call:
5+
inputs:
6+
python-version:
7+
description: List of Python versions to be used
8+
default: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
9+
required: false
10+
type: string
511

612
jobs:
713
lint_check:
814
name: Lint check
915
runs-on: ubuntu-latest
1016
strategy:
1117
matrix:
12-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] # All supported Python versions.
18+
python-version: ${{ fromJSON(inputs.python-version)}}
1319

1420
steps:
1521
- name: Checkout repository

.github/workflows/python_type_check.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ name: Type check
22

33
on:
44
workflow_call:
5+
inputs:
6+
python-version:
7+
description: List of Python versions to be used
8+
default: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
9+
required: false
10+
type: string
511

612
jobs:
713
type_check:
814
name: Type check
915
runs-on: ubuntu-latest
1016
strategy:
1117
matrix:
12-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] # All supported Python versions.
18+
python-version: ${{ fromJSON(inputs.python-version)}}
1319

1420
steps:
1521
- name: Checkout repository

.github/workflows/python_unit_tests.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ on:
66
httpbin_url:
77
required: false
88
description: Used to set the HTTPBIN_URL environment variable
9+
inputs:
10+
python-version:
11+
description: List of Python versions to be used
12+
default: '["3.9", "3.10", "3.11", "3.12", "3.13"]'
13+
required: false
14+
type: string
915

1016
jobs:
1117
unit_tests:
@@ -14,7 +20,7 @@ jobs:
1420
fail-fast: false
1521
matrix:
1622
os: ["ubuntu-latest", "windows-latest"]
17-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] # All supported Python versions.
23+
python-version: ${{ fromJSON(inputs.python-version)}}
1824
runs-on: ${{ matrix.os }}
1925
env:
2026
HTTPBIN_URL: ${{ secrets.httpbin_url || 'https://httpbin.org' }}

0 commit comments

Comments
 (0)