ci: skip tests on Markdown-only PRs without leaving required checks pending
Closed
FA
21d ago+107+107+012345678901234567890123456789-8-8-0123456789
Problem
unit_tests.yml, integration_tests.yml, integration_app_harness.yml and reflex_init_in_docker_test.yml use a pull_request paths-ignore: "**/*.md". A workflow that path filters skip reports no status. Branch protection requires 40 of their jobs by name, so a Markdown-only PR (for example #7327) shows them as "Expected — Waiting for status to be reported" forever and cannot merge.
Fix
- New reusable workflow
detect_changes.yml. Onpull_requestit diffs the merge commit against its base (HEAD^1..HEAD) and outputscode=falseonly when every changed file is*.md. On other events it outputscode=true. - The four workflows always start on
pull_request. Their test jobs useneeds: changesandif: needs.changes.outputs.code == 'true'. Thepushtrigger keeps itspaths-ignore. - One gate job per workflow:
unit-tests-result,integration-tests-result,integration-app-harness-result,reflex-init-in-docker-test-result. It runs withif: always()and fails only when a needed job failed or was cancelled. A skipped test job counts as a pass. - Python 3.15 legs get
continue-on-error. Branch protection does not require them today, and the gates keep it that way.
On a Markdown-only PR, the tests do not run. Only the ~10 s detect job and the ~5 s gate jobs run.
Required admin follow-up (branch protection)
A matrix job that its if skips does not report its per-leg check names, so the current 40 per-leg required checks would still wait. After this merges, in branch protection for main:
- Remove the required checks
unit-tests (…),integration-app-harness (…),integration-app-harness-playwright (…),example-counter-and-nba-proxy (…),reflex-docs (…),rx-shout-from-templateandreflex-install-and-init. - Add the required checks
unit-tests-result,integration-tests-result,integration-app-harness-resultandreflex-init-in-docker-test-result.
Verification
actionlintpasses on all five workflow files.- I ran the detect logic locally against real PR merge refs: #7327 (docs only) →
code=false; #7341, #7344 and #7345 (code +.mdnews fragments) →code=true; an empty diff →code=true. - This PR changes
.ymlfiles, so its own run covers thecode=truepath. The first Markdown-only PR after the merge will cover the skip path.