ci: add python-versions input parameter to workflow (#3511)

* 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
This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-08-22 15:49:42 -03:00 • committed by GitHub
commit 5e2d9b2c22
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -27,9 +27,15 @@ on:
description: "Store API Key" description: "Store API Key"
required: false required: false
type: string type: string
python-versions:
description: "Python Versions"
required: false
type: string
default: "['3.10']"
pull_request: pull_request:
types: [synchronize, labeled] types: [synchronize, labeled]
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -74,7 +80,7 @@ jobs:
if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }} if: ${{ needs.path-filter.outputs.python == 'true' || needs.path-filter.outputs.tests == 'true' }}
uses: ./.github/workflows/python_test.yml uses: ./.github/workflows/python_test.yml
with: with:
python-versions: ${{ inputs.python-versions }} python-versions: ${{ inputs.python-versions || '["3.10"]' }}
test-frontend: test-frontend:
needs: path-filter needs: path-filter
@ -117,4 +123,4 @@ jobs:
echo $JOBS_JSON echo $JOBS_JSON
echo $RESULTS_JSON echo $RESULTS_JSON
echo "Exiting with $EXIT_CODE" echo "Exiting with $EXIT_CODE"
exit $EXIT_CODE exit $EXIT_CODE

View file

@ -14,6 +14,11 @@ on:
description: "(Optional) Branch to checkout" description: "(Optional) Branch to checkout"
required: false required: false
type: string type: string
python-versions:
description: "(Optional) Python versions to test"
required: true
type: string
default: "['3.10', '3.11', '3.12']"
env: env:
POETRY_VERSION: "1.8.2" POETRY_VERSION: "1.8.2"
NODE_VERSION: "21" NODE_VERSION: "21"
@ -24,7 +29,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ${{ fromJson(inputs.python-versions) }} python-version: ${{ fromJson(inputs.python-versions || '["3.10", "3.11", "3.12"]' ) }}
splitCount: [5] splitCount: [5]
group: [1, 2, 3, 4, 5] group: [1, 2, 3, 4, 5]
env: env:
@ -60,7 +65,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: ${{ fromJson(inputs.python-versions) }} python-version: ${{ fromJson(inputs.python-versions || '["3.10", "3.11", "3.12"]') }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}