feat(ci): path-filter gate + concurrency cancel-in-progress for size-limit#37
Merged
Conversation
Two wins to cut CI minutes spent on size-limit: 1. Path-filter gate — a new `changes` job uses dorny/paths-filter to detect whether bundle inputs changed (src/**, public/**, package.json, pnpm-lock.yaml, next.config.*, .size-limit.json). The size-limit job now depends on both `unit` and `changes`, and only runs when bundle inputs actually changed. Most docs/CI/Makefile PRs skip the whole ~2-minute size-limit job. 2. Concurrency cancel-in-progress — only on PRs (not master/tag pushes). Force-pushing or amending a PR now cancels the prior in-flight run instead of letting two runs compete for minutes. No caller changes required. The filter defaults cover the common Next.js layout; repos with different structures will see the gate conservatively allow the size-limit job (src/ is the most common bundle input path).
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.
Summary
Two wins to cut CI minutes spent on the size-limit job.
1. Path-filter gate
New
changesjob usesdorny/paths-filter@v3to detect whether bundleinputs actually changed in the PR:
src/**public/**package.jsonpnpm-lock.yamlnext.config.*.size-limit.jsonThe size-limit job now depends on both
unitandchanges, and onlyruns when the filter reports changes. Most docs/CI/Makefile PRs skip
the full ~2-minute size-limit job (which runs
pnpm buildtwice —once on the base branch, once on the PR).
Example: https://github.com/whengas/whengas-ui/pull/38 (Makefile-only)
would have skipped size-limit under this PR, saving the ~2 minutes.
2. Concurrency cancel-in-progress
Added workflow-level concurrency group:
Only PRs get cancelled — master/tag pushes run to completion so
version-tag verification isn't aborted mid-run.
Caller impact
None — no new inputs, no breaking changes. Callers pick it up
automatically via
@master.Test plan
changesruns,reports
bundle=false, size-limit job skippedsrc/**:changesreportsbundle=true, size-limit job runs as before