@@ -57,21 +57,18 @@ jobs:
5757 run :
5858 working-directory : ${{ github.workspace }}
5959 outputs :
60- matrix : ${{ steps.matrix.outputs.matrix }}
60+ full-matrix : ${{ steps.matrix.outputs.full-matrix }}
61+ pr-matrix : ${{ steps.matrix.outputs.pr-matrix }}
6162 pytest-targets : ${{ steps.targets.outputs.targets }}
63+ is-scoped : ${{ steps.targets.outputs.is-scoped }}
6264 steps :
6365 - id : matrix
6466 shell : bash
65- env :
66- IS_PR : ${{ github.event_name == 'pull_request' }}
67- HAS_FULL_LABEL : ${{ contains(github.event.pull_request.labels.*.name, 'full-test') }}
6867 run : |
69- if [[ "$IS_PR" == "true" && "$HAS_FULL_LABEL" != "true" ]]; then
70- MATRIX='{"include":[{"os":"ubuntu-24.04","python-version":"3.14"},{"os":"windows-2025","python-version":"3.14"},{"os":"macos-15-intel","python-version":"3.14"},{"os":"ubuntu-24.04-arm","python-version":"3.14"},{"os":"windows-11-arm","python-version":"3.14"},{"os":"macos-latest","python-version":"3.14"}]}'
71- else
72- MATRIX='{"include":[{"os":"ubuntu-24.04","python-version":"3.11"},{"os":"ubuntu-24.04","python-version":"3.14"},{"os":"windows-2025","python-version":"3.11"},{"os":"windows-2025","python-version":"3.14"},{"os":"macos-15-intel","python-version":"3.11"},{"os":"macos-15-intel","python-version":"3.14"},{"os":"ubuntu-24.04-arm","python-version":"3.11"},{"os":"ubuntu-24.04-arm","python-version":"3.14"},{"os":"windows-11-arm","python-version":"3.12"},{"os":"windows-11-arm","python-version":"3.14"},{"os":"macos-latest","python-version":"3.11"},{"os":"macos-latest","python-version":"3.14"}]}'
73- fi
74- echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT"
68+ FULL_MATRIX='{"include":[{"os":"ubuntu-24.04","python-version":"3.11"},{"os":"ubuntu-24.04","python-version":"3.14"},{"os":"windows-2025","python-version":"3.11"},{"os":"windows-2025","python-version":"3.14"},{"os":"macos-15-intel","python-version":"3.11"},{"os":"macos-15-intel","python-version":"3.14"},{"os":"ubuntu-24.04-arm","python-version":"3.11"},{"os":"ubuntu-24.04-arm","python-version":"3.14"},{"os":"windows-11-arm","python-version":"3.12"},{"os":"windows-11-arm","python-version":"3.14"},{"os":"macos-latest","python-version":"3.11"},{"os":"macos-latest","python-version":"3.14"}]}'
69+ PR_MATRIX='{"include":[{"os":"ubuntu-24.04","python-version":"3.14"}]}'
70+ echo "full-matrix=$FULL_MATRIX" >> "$GITHUB_OUTPUT"
71+ echo "pr-matrix=$PR_MATRIX" >> "$GITHUB_OUTPUT"
7572
7673 - name : Checkout for diff
7774 if : github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full-test')
9087 if [[ "$IS_PR" != "true" || "$HAS_FULL_LABEL" == "true" ]]; then
9188 echo "Full suite (dispatch or full-test label)"
9289 echo "targets=tests/" >> "$GITHUB_OUTPUT"
90+ echo "is-scoped=false" >> "$GITHUB_OUTPUT"
9391 exit 0
9492 fi
9593
@@ -107,13 +105,16 @@ jobs:
107105 if [[ -n "$SOURCE_NON_TEST" || -n "$WORKFLOW_SELF" || -n "$INFRA_TEST" ]]; then
108106 echo "Full suite (source/workflow/test-infra changes)"
109107 echo "targets=tests/" >> "$GITHUB_OUTPUT"
108+ echo "is-scoped=false" >> "$GITHUB_OUTPUT"
110109 elif [[ -n "$TEST_FILES" ]]; then
111110 T=$(echo "$TEST_FILES" | sed 's|^pywry/||' | tr '\n' ' ' | sed 's/ *$//')
112111 echo "Scoped to changed test files: $T"
113112 echo "targets=$T" >> "$GITHUB_OUTPUT"
113+ echo "is-scoped=true" >> "$GITHUB_OUTPUT"
114114 else
115115 echo "No pywry source/test changes; skipping pytest selection"
116116 echo "targets=__skip__" >> "$GITHUB_OUTPUT"
117+ echo "is-scoped=false" >> "$GITHUB_OUTPUT"
117118 fi
118119
119120 test :
@@ -130,7 +131,7 @@ jobs:
130131 # ``sqlcipher3`` is a source build against the SQLCipher C
131132 # library installed in the ``Build SQLCipher`` step below, so
132133 # any Python ABI works (no binary-wheel coverage gaps).
133- matrix : ${{ fromJSON(needs.gen-matrix.outputs.matrix) }}
134+ matrix : ${{ fromJSON(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'full-test') ? needs.gen-matrix.outputs.pr-matrix : needs.gen-matrix.outputs.full- matrix) }}
134135
135136 steps :
136137 - uses : actions/checkout@v5
@@ -274,7 +275,7 @@ jobs:
274275 - name : Install dependencies
275276 run : |
276277 python -m pip install --upgrade pip
277- pip install -e ".[dev]"
278+ pip install -e ".[dev]" pytest-xdist
278279
279280 - name : Verify Docker (Linux)
280281 if : runner.os == 'Linux'
@@ -327,7 +328,7 @@ jobs:
327328 NO_AT_BRIDGE : " 1"
328329 PYTEST_TARGETS : ${{ needs.gen-matrix.outputs.pytest-targets }}
329330 run : |
330- dbus-run-session -- xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" python -m pytest -c pytest.ini $PYTEST_TARGETS -v --tb=short
331+ dbus-run-session -- xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x24" python -m pytest -c pytest.ini $PYTEST_TARGETS -n auto - v --tb=short
331332 rc=$?
332333 # Exit 5 = no tests collected after platform filtering on a scoped run; treat as success.
333334 if [[ $rc -eq 5 && "$PYTEST_TARGETS" != "tests/" ]]; then rc=0; fi
@@ -342,7 +343,7 @@ jobs:
342343 PYTEST_TARGETS : ${{ needs.gen-matrix.outputs.pytest-targets }}
343344 shell : pwsh
344345 run : |
345- python -m pytest -c pytest.ini $env:PYTEST_TARGETS.Split(' ') -v --tb=short --ignore=tests/test_state_redis_integration.py --ignore=tests/test_auth_rbac_integration.py --ignore=tests/test_deploy_mode_integration.py --ignore=tests/test_e2e_deploy_mode.py --ignore=tests/test_e2e_rbac_widgets.py -m "not redis and not container"
346+ python -m pytest -c pytest.ini $env:PYTEST_TARGETS.Split(' ') -n auto - v --tb=short --ignore=tests/test_state_redis_integration.py --ignore=tests/test_auth_rbac_integration.py --ignore=tests/test_deploy_mode_integration.py --ignore=tests/test_e2e_deploy_mode.py --ignore=tests/test_e2e_rbac_widgets.py -m "not redis and not container"
346347 if ($LASTEXITCODE -eq 5 -and $env:PYTEST_TARGETS -ne 'tests/') { exit 0 }
347348 exit $LASTEXITCODE
348349
@@ -355,7 +356,7 @@ jobs:
355356 PYTEST_TARGETS : ${{ needs.gen-matrix.outputs.pytest-targets }}
356357 shell : pwsh
357358 run : |
358- python -m pytest -c pytest.ini $env:PYTEST_TARGETS.Split(' ') -v --tb=short --ignore=tests/test_state_redis_integration.py --ignore=tests/test_auth_rbac_integration.py --ignore=tests/test_deploy_mode_integration.py --ignore=tests/test_e2e_deploy_mode.py --ignore=tests/test_e2e_rbac_widgets.py --ignore=tests/test_inline_ssl.py -m "not redis and not container"
359+ python -m pytest -c pytest.ini $env:PYTEST_TARGETS.Split(' ') -n auto - v --tb=short --ignore=tests/test_state_redis_integration.py --ignore=tests/test_auth_rbac_integration.py --ignore=tests/test_deploy_mode_integration.py --ignore=tests/test_e2e_deploy_mode.py --ignore=tests/test_e2e_rbac_widgets.py --ignore=tests/test_inline_ssl.py -m "not redis and not container"
359360 if ($LASTEXITCODE -eq 5 -and $env:PYTEST_TARGETS -ne 'tests/') { exit 0 }
360361 exit $LASTEXITCODE
361362
@@ -365,7 +366,7 @@ jobs:
365366 PYWRY_HEADLESS : " 1"
366367 PYTEST_TARGETS : ${{ needs.gen-matrix.outputs.pytest-targets }}
367368 run : |
368- python -m pytest -c pytest.ini $PYTEST_TARGETS -v --tb=short
369+ python -m pytest -c pytest.ini $PYTEST_TARGETS -n auto - v --tb=short
369370 rc=$?
370371 if [[ $rc -eq 5 && "$PYTEST_TARGETS" != "tests/" ]]; then rc=0; fi
371372 exit $rc
@@ -377,7 +378,7 @@ jobs:
377378 PYWRY_DEPLOY__STATE_BACKEND : " memory"
378379 PYTEST_TARGETS : ${{ needs.gen-matrix.outputs.pytest-targets }}
379380 run : |
380- python -m pytest -c pytest.ini $PYTEST_TARGETS -v --tb=short --ignore=tests/test_state_redis_integration.py --ignore=tests/test_auth_rbac_integration.py --ignore=tests/test_deploy_mode_integration.py --ignore=tests/test_e2e_deploy_mode.py --ignore=tests/test_e2e_rbac_widgets.py -m "not redis and not container"
381+ python -m pytest -c pytest.ini $PYTEST_TARGETS -n auto - v --tb=short --ignore=tests/test_state_redis_integration.py --ignore=tests/test_auth_rbac_integration.py --ignore=tests/test_deploy_mode_integration.py --ignore=tests/test_e2e_deploy_mode.py --ignore=tests/test_e2e_rbac_widgets.py -m "not redis and not container"
381382 rc=$?
382383 if [[ $rc -eq 5 && "$PYTEST_TARGETS" != "tests/" ]]; then rc=0; fi
383384 exit $rc
0 commit comments