99 type : boolean
1010 description : " If true, run the full lint job in this workflow."
1111 default : true
12+ force_all_checks :
13+ type : boolean
14+ description : " If true, run all test/example/package lanes regardless of changed-path filters."
15+ default : false
16+ run_package_compat :
17+ type : boolean
18+ description : " If true, run the cross-version package compatibility lanes."
19+ default : false
20+ python_versions :
21+ type : string
22+ description : ' JSON array of Python versions to use for multi-version jobs, e.g. ["3.10", "3.12"].'
23+ default : ' ["3.10", "3.11", "3.12", "3.13", "3.14"]'
1224 secrets :
1325 CODECOV_TOKEN :
1426 required : false
@@ -33,15 +45,25 @@ jobs:
3345 contents : read
3446 pull-requests : read
3547 outputs :
36- run_tests : ${{ steps.filter.outputs.run_tests }}
37- run_examples : ${{ steps.filter.outputs.run_examples }}
38- run_package : ${{ steps.filter.outputs.run_package }}
48+ run_tests : ${{ steps.force.outputs.run_tests || steps. filter.outputs.run_tests }}
49+ run_examples : ${{ steps.force.outputs.run_examples || steps. filter.outputs.run_examples }}
50+ run_package : ${{ steps.force.outputs.run_package || steps. filter.outputs.run_package }}
3951 steps :
52+ - name : Force all lanes
53+ if : ${{ inputs.force_all_checks }}
54+ id : force
55+ run : |
56+ echo "run_tests=true" >> "$GITHUB_OUTPUT"
57+ echo "run_examples=true" >> "$GITHUB_OUTPUT"
58+ echo "run_package=true" >> "$GITHUB_OUTPUT"
59+
4060 - uses : actions/checkout@v6
61+ if : ${{ !inputs.force_all_checks }}
4162 with :
4263 fetch-depth : 0
4364
4465 - name : Detect changed paths
66+ if : ${{ !inputs.force_all_checks }}
4567 id : filter
4668 uses : dorny/paths-filter@v3
4769 with :
@@ -113,7 +135,7 @@ jobs:
113135 strategy :
114136 fail-fast : false
115137 matrix :
116- python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
138+ python-version : ${{ fromJSON(inputs.python_versions) }}
117139 steps :
118140 - uses : actions/checkout@v6
119141
@@ -182,7 +204,7 @@ jobs:
182204 strategy :
183205 fail-fast : false
184206 matrix :
185- python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
207+ python-version : ${{ fromJSON(inputs.python_versions) }}
186208 steps :
187209 - uses : actions/checkout@v6
188210
@@ -256,7 +278,7 @@ jobs:
256278 strategy :
257279 fail-fast : false
258280 matrix :
259- python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
281+ python-version : ${{ fromJSON(inputs.python_versions) }}
260282 steps :
261283 - uses : actions/checkout@v6
262284
@@ -344,17 +366,19 @@ jobs:
344366
345367 test-pip-install-no-lock :
346368 needs : changes
347- if : ${{ needs.changes.outputs.run_package == 'true' }}
369+ if : ${{ inputs.run_package_compat && needs.changes.outputs.run_package == 'true' }}
348370 runs-on : ubuntu-latest
371+ env :
372+ SELECTED_PYTHON_VERSIONS : ${{ join(fromJSON(inputs.python_versions), ' ') }}
349373 steps :
350374 - uses : actions/checkout@v5
351375
352376 - name : Install uv
353377 uses : astral-sh/setup-uv@v6
354378
355- - name : Test pip install across Python versions
379+ - name : Test pip install across selected Python versions
356380 run : |
357- for py_version in 3.10 3.11 3.12 3.13 3.14 ; do
381+ for py_version in $SELECTED_PYTHON_VERSIONS ; do
358382 echo "=========================================="
359383 echo "Testing Python $py_version"
360384 echo "=========================================="
@@ -379,17 +403,19 @@ jobs:
379403
380404 test-pip-install-no-dev-headers :
381405 needs : changes
382- if : ${{ needs.changes.outputs.run_package == 'true' }}
406+ if : ${{ inputs.run_package_compat && needs.changes.outputs.run_package == 'true' }}
383407 runs-on : ubuntu-latest
408+ env :
409+ SELECTED_PYTHON_VERSIONS : ${{ join(fromJSON(inputs.python_versions), ' ') }}
384410 steps :
385411 - uses : actions/checkout@v5
386412
387413 - name : Install uv
388414 uses : astral-sh/setup-uv@v6
389415
390- - name : Test pip install without dev headers across Python versions
416+ - name : Test pip install without dev headers across selected Python versions
391417 run : |
392- for py_version in 3.10 3.11 3.12 3.13 3.14 ; do
418+ for py_version in $SELECTED_PYTHON_VERSIONS ; do
393419 echo "=========================================="
394420 echo "Testing Python $py_version (no dev headers)"
395421 echo "=========================================="
0 commit comments