Skip to content

ci: stop running the full matrix twice on every PR - #87

Merged
thad0ctor merged 1 commit into
mainfrom
fix/ci-duplicate-runs-issue86
Jul 16, 2026
Merged

ci: stop running the full matrix twice on every PR#87
thad0ctor merged 1 commit into
mainfrom
fix/ci-duplicate-runs-issue86

Conversation

@thad0ctor

@thad0ctor thad0ctor commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Fixes #86.

Problem

ci.yml listened on both push: branches: ["**"] and pull_request. Any PR from a branch in this repo matched both events, so lint, build, and the 4-way CPU matrix each ran twice per push — visible on #83 as paired (push) / (pull_request) checks.

The existing concurrency group could not collapse the pair. github.ref resolves differently per event — refs/heads/<branch> on push vs refs/pull/<n>/merge on pull_request — so each run landed in its own group and neither cancelled the other.

Fix

Scope the push trigger to main:

  • PR branches stay covered by the pull_request event.
  • main stays covered on merge.
  • Tags are untouched — release.yml owns those, and ci.yml still does not fire on tag pushes.

Also refreshed the ci.yml header comment and corrected a now-stale cross-reference in release.yml that described ci.yml's triggers.

Tradeoff

Pushing a branch with no PR open no longer triggers CI automatically. This is the conventional arrangement, and it is the only way to get one run per PR without querying the API mid-workflow. The existing workflow_dispatch covers pre-PR branch runs from the Actions tab.

Verification

Both workflows parse, and the resulting trigger sets are as intended: CI on push→main + pull_request + workflow_dispatch; Release on push→tags v*. actionlint was not available in the working environment, so that check was skipped rather than passed. The real confirmation is this PR's own check list — one run per context instead of two.

Summary by CodeRabbit

  • Chores
    • Limited continuous integration runs for direct pushes to the main branch.
    • Pull request checks continue to run as before.
    • GPU tests remain available through manual workflow triggering.
    • Updated workflow documentation to clarify when checks run.

ci.yml listened on both `push: branches: ["**"]` and `pull_request`, so any
PR from a branch in this repo triggered two independent runs of lint, build
and the 4-way CPU matrix. The `concurrency` group could not collapse them
because `github.ref` differs per event: `refs/heads/<branch>` on push vs
`refs/pull/<n>/merge` on pull_request, putting each run in its own group.

Scope the push trigger to main. PR branches stay covered by `pull_request`,
main stays covered on merge, and tags are untouched (release.yml owns those).
Pre-PR branch runs remain available via the existing workflow_dispatch.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2cc3d22a-4d95-4c01-afdd-5596341ebd62

📥 Commits

Reviewing files that changed from the base of the PR and between df3a615 and d2ee550.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The CI workflow’s push trigger now runs only on main instead of all branches. Comments in the CI and release workflows were updated to document the pull request and main-branch behavior, with GPU tests remaining manual.

Changes

CI Trigger Scoping

Layer / File(s) Summary
Scope CI workflow triggers
.github/workflows/ci.yml, .github/workflows/release.yml
The CI push trigger is restricted to main, and workflow comments describe the updated trigger behavior and tag-push exclusion.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main CI change and its effect on duplicate PR runs.
Linked Issues check ✅ Passed Limiting push runs to main removes the duplicate push plus pull_request CI runs described in #86.
Out of Scope Changes check ✅ Passed The changes stay within CI trigger scoping and comment updates, with no unrelated workflow logic changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-duplicate-runs-issue86

Comment @coderabbitai help to get the list of available commands.

@thad0ctor
thad0ctor merged commit 1751115 into main Jul 16, 2026
8 checks passed
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.

Fix Duplicate Testing on PRs

1 participant