From 4c58c19bc2b6ebdccb5a1673ede95692c1d0b7f9 Mon Sep 17 00:00:00 2001 From: flint Date: Wed, 14 Oct 2026 01:37:25 +0000 Subject: [PATCH] ci: cancel superseded PR runs and smoke linux-x64 only on a pull request Give the two pull_request workflows a workflow-level concurrency group: a run keyed by the PR number is cancelled by a newer push to the same PR, while a push to main gets a group unique per run, so its runs are never cancelled. Restrict the compiled-binary smoke matrix to linux-x64 on pull_request; push to main keeps the full linux-arm64/darwin-x64/darwin-arm64 matrix. Every required status check still reports on a pull request. --- .../unreleased/changed-ci-pr-run-load.md | 3 +++ .github/workflows/smoke.yml | 27 ++++++++++--------- .github/workflows/test.yml | 6 +++++ 3 files changed, 23 insertions(+), 13 deletions(-) create mode 100644 .changelog/unreleased/changed-ci-pr-run-load.md diff --git a/.changelog/unreleased/changed-ci-pr-run-load.md b/.changelog/unreleased/changed-ci-pr-run-load.md new file mode 100644 index 00000000..80b2d107 --- /dev/null +++ b/.changelog/unreleased/changed-ci-pr-run-load.md @@ -0,0 +1,3 @@ +- **Superseded pull-request runs are cancelled and the compiled-binary smoke runs linux-x64 only on a pull request.** + + A push to main keeps the full OS/arch matrix. diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 40e2450d..44eb1bf5 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -19,25 +19,26 @@ on: permissions: contents: read +# A superseded PR head's runs are cancelled (the group is the PR number); a push +# to main keeps a group unique per run, so its runs are never cancelled. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: smoke: name: Smoke ${{ matrix.target }} strategy: fail-fast: false matrix: - include: - - target: linux-x64 - runs-on: ubuntu-latest - - target: linux-arm64 - runs-on: ubuntu-24.04-arm - # GitHub retired Intel mac runners (macos-13 queues forever). - # This job runs on Apple Silicon under Rosetta 2 translation — - # bun-compiled x64 binaries auto-translate. Bare-metal Intel mac - # is untested and that is a documented gap, not a hidden one. - - target: darwin-x64 - runs-on: macos-latest - - target: darwin-arm64 - runs-on: macos-latest + # On a pull request only linux-x64 is smoked; push to main keeps the full + # matrix. + # + # GitHub retired Intel mac runners (macos-13 queues forever). + # This job runs on Apple Silicon under Rosetta 2 translation — + # bun-compiled x64 binaries auto-translate. Bare-metal Intel mac + # is untested and that is a documented gap, not a hidden one. + include: ${{ github.event_name == 'pull_request' && fromJSON('[{"target":"linux-x64","runs-on":"ubuntu-latest"}]') || fromJSON('[{"target":"linux-x64","runs-on":"ubuntu-latest"},{"target":"linux-arm64","runs-on":"ubuntu-24.04-arm"},{"target":"darwin-x64","runs-on":"macos-latest"},{"target":"darwin-arm64","runs-on":"macos-latest"}]') }} runs-on: ${{ matrix.runs-on }} steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10364350..1c4e1635 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,6 +10,12 @@ on: # what its steps use, and names the step beside each grant. permissions: {} +# A superseded PR head's runs are cancelled (the group is the PR number); a push +# to main keeps a group unique per run, so its runs are never cancelled. +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: build: name: Build (TypeScript strict)