From ffe4c17002c92f9df569ebeec562382de04b0aac Mon Sep 17 00:00:00 2001 From: SteveBot <1153461+unbraind@users.noreply.github.com> Date: Sat, 14 Nov 2026 18:48:11 +0100 Subject: [PATCH] Run Linux CI jobs on local runners when PM_LOCAL_RUNNER=on, and cancel superseded PR runs The fleet's CI saturated GitHub's 20 concurrent jobs: about 60,800 runner wall-minutes in 48 h. With the repository variable PM_LOCAL_RUNNER=on, the Linux jobs in this workflow (2) run on the fleet's local ephemeral runners ([self-hosted, pm-local]): one fresh, resource-capped container per job. Fork pull requests always stay on ubuntu-latest. A new push to a pull request cancels that PR's earlier run; pushes to main and manual runs never wait for or cancel each other. Required check names are unchanged. --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e15b1f66..ea9b9f7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,17 @@ on: permissions: contents: read +# Linux jobs run on the fleet's local, ephemeral runners (label pm-local) when the repository variable +# PM_LOCAL_RUNNER is 'on'; fork pull requests always stay on GitHub-hosted runners. Unset or 'off': ubuntu-latest. +# A new push to a pull request supersedes its earlier CI run: cancel it instead of letting both hold runners. +# Pushes to main and manual runs get a group of their own, so they never wait for or cancel each other. +concurrency: + group: ci-${{ github.event.pull_request.number && format('pr-{0}', github.event.pull_request.number) || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test: - runs-on: ubuntu-latest + runs-on: ${{ (vars.PM_LOCAL_RUNNER == 'on' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)) && fromJSON('["self-hosted","pm-local"]') || 'ubuntu-latest' }} strategy: fail-fast: false matrix: @@ -71,7 +79,7 @@ jobs: run: npm run test:bun bun-release: - runs-on: ubuntu-latest + runs-on: ${{ (vars.PM_LOCAL_RUNNER == 'on' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)) && fromJSON('["self-hosted","pm-local"]') || 'ubuntu-latest' }} strategy: fail-fast: false matrix: