Write the test-to-code ratio guardrail check.
File
.github/workflows/guardrail-test-ratio.yml
What
- Trigger: PR opened or synchronized
- Calculate ratio of test lines to implementation lines in PR diff
- Test files identified by naming convention (test, spec, tests/)
- Configurable threshold from config.yaml (default: 0.5)
- Below threshold:
action_required; above: success
- Check for non-stale PR approval override
Reference
- docs/design.md: Test-to-Code Ratio (Layer 4)
Write the test-to-code ratio guardrail check.
File
.github/workflows/guardrail-test-ratio.ymlWhat
action_required; above:successReference