Skip to content

Skip CI build/test jobs on doc-only changes - #29

Closed
halotukozak wants to merge 1 commit into
masterfrom
skip-ci-for-docs-only-changes
Closed

Skip CI build/test jobs on doc-only changes#29
halotukozak wants to merge 1 commit into
masterfrom
skip-ci-for-docs-only-changes

Conversation

@halotukozak

Copy link
Copy Markdown
Collaborator

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 changes job (dorny/paths-filter) that checks whether **/*.scala, project.scala, .scalafmt.conf, or ci.yml itself changed. Scalafmt, Test and Compile are gated behind it (needs: changes + job-level if).

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-platform is 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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant