Skip CI build/test jobs on doc-only changes - #29
Closed
halotukozak wants to merge 1 commit into
Closed
Conversation
Add a `changes` gate (dorny/paths-filter) that checks whether a push/PR
touches actual code (**/*.scala, project.scala, .scalafmt.conf, or ci.yml
itself). Scalafmt, Test and Compile are gated behind it with a job-level
`if`, so a PR that only touches README.md/renovate.json/.github/sync.yml
etc. no longer spins up the full build+test matrix.
A skipped job reports "Success" and satisfies a required status check, but
skipping a *matrix* job at the top level leaves its required inner checks
("Test (scala-js)", "Test (scala-native)") pending forever instead
(actions/runner#952). So test-cross-platform is split into two plain jobs,
test-scala-js and test-scala-native, that can be individually skipped.
`compile` stays a matrix (its per-platform checks aren't required, so a
top-level skip there is harmless).
Required status check names are unchanged: Scalafmt, Test,
Test (scala-js), Test (scala-native).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019awuXm5QZgXajLw3PvGo1s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every push/PR runs the full test+compile matrix on all 3 platforms, even when nothing but docs/config changed (README, renovate.json, .github/sync.yml, …).
Fix
Add a
changesjob (dorny/paths-filter) that checks whether**/*.scala,project.scala,.scalafmt.conf, orci.ymlitself changed.Scalafmt,TestandCompileare gated behind it (needs: changes+ job-levelif).A skipped job reports Success and satisfies a required status check — that's the documented, supported way to do this. But skipping a matrix job at the top level leaves its required inner checks pending forever instead (actions/runner#952), which would hang doc-only PRs. So
test-cross-platformis split into two plain jobs,test-scala-js/test-scala-native, each individually skippable.compile's per-platform checks aren't required, so it stays a matrix.Required status check names are unchanged:
Scalafmt,Test,Test (scala-js),Test (scala-native)— no branch protection changes needed.Sources
🤖 Generated with Claude Code