ci: skip test and e2e-test jobs for docs-only changes - #4455
Conversation
Both are required status checks, so they must still run and report success (rather than being skipped via workflow-level path filters, which would leave the check stuck pending and block merging). Each job now checks whether the diff touches anything outside docs/, *.md and *.rst via dorny/paths-filter, and skips its actual work when it doesn't - docs-only changes can't affect Go code or e2e behavior, so there's nothing for either job to catch, and skipping avoids spending CI minutes (and hitting flaky tests) on runs that can't be revealing anything.
❌ 5 blocking issues (5 total)
|
|
Coverage Impact ⬆️ Merging this pull request will increase total coverage on 🛟 Help
|
stevenvegt
left a comment
There was a problem hiding this comment.
Agreed with the changes.
I find all the if statements a bit ugly, but that might be the only way?
I saw a "credential persistence through GitHub Actions artifacts" warning that might be something to look into?
A job skipped via `if:` reports as a passing check, same as a workflow-level paths-ignore trigger would if it worked for required checks (it doesn't: the workflow just never runs, leaving the check stuck pending forever). That means the per-step `if: steps.filter.outputs.code == 'true'` on every single step wasn't needed - one job-level `if:` does the same job with far less repetition. Splits the path-filter into its own `changes` job (output: `code`), and both `test` and `e2e-test` become `needs: changes` + a single job-level `if:` instead of duplicating the condition on every step. `test`/`e2e-test` keep their original job names so branch protection's required-status-check matching is unaffected.
Simplified it |

What
testande2e-testare required status checks. Both now check whether the PR/push diff touches anything outsidedocs/,*.mdand*.rst(viadorny/paths-filter), and skip their actual work when it doesn't.Why
All the code checks, especially the unit and e2e tests, are slow and consume resources that aren't required - not very sustainable.
Docs-only changes can't affect Go code or e2e behavior, so there's nothing for either job to catch — but skipping them entirely at the workflow-trigger level (
paths-ignore) would leave the required check stuck pending forever and block merging, since GitHub doesn't auto-satisfy a required check that never ran. Gating the steps instead of the trigger keeps the job itself running (so the required check resolves quickly with a pass) while skipping the actual test/build/e2e work.This also sidesteps spending CI minutes, and occasionally hitting flaky tests (e.g. the embedded-NATS timing flake in
TestNetwork_Reprocess), on changes that can't have broken anything either job tests.Scope
.github/workflows/go-test.yamland.github/workflows/e2e-tests.yamlonly. This PR itself touches.github/**, notdocs/**, so it exercises the full test/e2e run as normal.Backports to V6.2 and V5.4 to follow once this is reviewed.