@@ -216,30 +216,41 @@ jobs:
216216 runs-on : ubuntu-latest
217217 steps :
218218 - uses : actions/checkout@v4
219+ # Try 3.14t first, then 3.13t. Use outcome (not conclusion): continue-on-error leaves conclusion "success"
220+ # even when setup fails, but outcome stays "failure" so we can chain fallbacks reliably.
219221 - uses : actions/setup-python@v5
220222 id : py314t
221223 continue-on-error : true
222224 with :
223225 python-version : ' 3.14t'
224226 - uses : actions/setup-python@v5
225227 id : py313t
226- if : steps.py314t.outcome == 'failure '
228+ if : steps.py314t.outcome != 'success '
227229 continue-on-error : true
228230 with :
229231 python-version : ' 3.13t'
232+ - name : Resolve free-threaded interpreter
233+ id : ft_py
234+ run : |
235+ ready=false
236+ if [[ '${{ steps.py314t.outcome }}' == 'success' ]] || [[ '${{ steps.py313t.outcome }}' == 'success' ]]; then
237+ ready=true
238+ fi
239+ echo "ready=${ready}" >> "$GITHUB_OUTPUT"
230240 - uses : dtolnay/rust-toolchain@stable
231- if : steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success '
241+ if : steps.ft_py.outputs.ready == 'true '
232242 - name : Install dependencies and build
233- if : steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success '
243+ if : steps.ft_py.outputs.ready == 'true '
234244 run : |
235- python -m pip install --upgrade pip
236- pip install maturin pytest
237- maturin develop --release
245+ python -m venv .venv
246+ ./.venv/bin/python -m pip install --upgrade pip
247+ ./.venv/bin/python -m pip install maturin pytest
248+ ./.venv/bin/python -m maturin develop --release
238249 - name : Run tests
239- if : steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success '
240- run : pytest tests/
250+ if : steps.ft_py.outputs.ready == 'true '
251+ run : ./.venv/bin/python -m pytest tests/
241252 - name : Free-threaded Python unavailable
242- if : ${{ !( steps.py314t.outcome == 'success' || steps.py313t.outcome == 'success') }}
253+ if : steps.ft_py.outputs.ready != 'true'
243254 run : |
244255 echo '::notice::No free-threaded Python (3.14t / 3.13t) available from setup-python for this runner; skipping extension tests.'
245256
0 commit comments