Skip to content

Commit

Permalink
ci: add python-versions input parameter to workflow (#3511)
Browse files Browse the repository at this point in the history
* ci: Add python-versions input parameter to workflow

* build: Update CI workflow with additional Python versions and default values.

* ci: Update default Python versions in matrix configuration

* build: Fix python version matrix generation in workflow
  • Loading branch information
ogabrielluiz committed Aug 27, 2024
1 parent b0d5a41 commit bcce299
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ on:
description: "Store API Key"
required: false
type: string
python-versions:
description: "Python Versions"
required: false
type: string
default: "['3.10']"
pull_request:
types: [synchronize, labeled]


concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -74,7 +80,7 @@ jobs:
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test.yml
with:
python-versions: ${{ inputs.python-versions }}
python-versions: ${{ inputs.python-versions || '["3.10"]' }}

test-frontend:
needs: path-filter
Expand Down Expand Up @@ -117,4 +123,4 @@ jobs:
echo $JOBS_JSON
echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE
exit $EXIT_CODE
9 changes: 7 additions & 2 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
description: "(Optional) Branch to checkout"
required: false
type: string
python-versions:
description: "(Optional) Python versions to test"
required: true
type: string
default: "['3.10', '3.11', '3.12']"
env:
POETRY_VERSION: "1.8.2"
NODE_VERSION: "21"
Expand All @@ -24,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJson(inputs.python-versions) }}
python-version: ${{ fromJson(inputs.python-versions || '["3.10", "3.11", "3.12"]' ) }}
splitCount: [5]
group: [1, 2, 3, 4, 5]
env:
Expand Down Expand Up @@ -60,7 +65,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJson(inputs.python-versions) }}
python-version: ${{ fromJson(inputs.python-versions || '["3.10", "3.11", "3.12"]') }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
Expand Down

0 comments on commit bcce299

Please sign in to comment.