Skip to content

feat(ci): path-filter gate + concurrency cancel-in-progress for size-limit#37

Merged
jr200 merged 1 commit into
masterfrom
feat/size-limit-path-gate
Apr 21, 2026
Merged

feat(ci): path-filter gate + concurrency cancel-in-progress for size-limit#37
jr200 merged 1 commit into
masterfrom
feat/size-limit-path-gate

Conversation

@jr200

@jr200 jr200 commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Two wins to cut CI minutes spent on the size-limit job.

1. Path-filter gate

New changes job uses dorny/paths-filter@v3 to detect whether bundle
inputs actually changed in the PR:

  • 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 the filter reports changes. Most docs/CI/Makefile PRs skip
the full ~2-minute size-limit job (which runs pnpm build twice —
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:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

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

  • YAML valid — same schema plus one new job
  • Next PR on whengas-ui with no src changes: changes runs,
    reports bundle=false, size-limit job skipped
  • Next PR on whengas-ui touching src/**: changes reports
    bundle=true, size-limit job runs as before
  • Force-push to an open PR: older run cancels, new run starts

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).
@jr200 jr200 merged commit 0d94f26 into master Apr 21, 2026
2 checks passed
@jr200 jr200 deleted the feat/size-limit-path-gate branch April 21, 2026 07:04
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