From d2ee55045666ddfb31497f6b7632f336f810028b Mon Sep 17 00:00:00 2001 From: thad0ctor Date: Thu, 16 Jul 2026 15:11:45 -0700 Subject: [PATCH] ci: stop running the full matrix twice on every PR (#86) 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/` on push vs `refs/pull//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. --- .github/workflows/ci.yml | 16 +++++++++++----- .github/workflows/release.yml | 2 +- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38e1060..a4a3770 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,19 @@ name: CI -# CPU job runs automatically on every push / PR. The GPU test job is opt-in -# (manual workflow_dispatch) because the kernel parity tests require a CUDA -# device + nvcc, which GitHub-hosted runners do not provide. Trigger it from -# the Actions tab if you have a self-hosted GPU runner labelled [self-hosted, gpu]. +# CPU job runs automatically on every pull request and on pushes to main. The +# push trigger is deliberately scoped to main: a branch that has a PR open is +# already covered by the `pull_request` event, and listening on both events for +# every branch runs the whole matrix twice per push. To test a branch before +# opening a PR, run the workflow from the Actions tab (workflow_dispatch). +# +# The GPU test job is opt-in (manual workflow_dispatch) because the kernel +# parity tests require a CUDA device + nvcc, which GitHub-hosted runners do not +# provide. Trigger it from the Actions tab if you have a self-hosted GPU runner +# labelled [self-hosted, gpu]. on: push: - branches: ["**"] + branches: ["main"] pull_request: workflow_dispatch: inputs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f037d4..e594a67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ name: Release # git tag v0.2.1.dev1 && git push origin v0.2.1.dev1 -> build + TestPyPI only # git tag v0.2.1 && git push origin v0.2.1 -> build + TestPyPI + PyPI # -# `ci.yml` intentionally runs on branch pushes and pull requests, not tag pushes. +# `ci.yml` intentionally runs on pull requests and pushes to main, not tag pushes. # This workflow therefore carries installed-wheel CPU and Transformers Trainer # gates. Every gate tests the artifact built in `build`, and every publish job # downloads that same artifact.