Skip to content

⚡ Cancel stale CI runs per PR to free the self-hosted runner#32

Closed
AhtishamShahid wants to merge 2 commits into
foss-mainfrom
fix/ci-concurrency-group
Closed

⚡ Cancel stale CI runs per PR to free the self-hosted runner#32
AhtishamShahid wants to merge 2 commits into
foss-mainfrom
fix/ci-concurrency-group

Conversation

@AhtishamShahid

Copy link
Copy Markdown

Problem

All 11 CI jobs are pinned to a single self-hosted runner (penpot-runner-02). When multiple jobs queue up on one runner they serialize. A run started on an earlier push can occupy the runner for the full 24-hour workflow timeout — causing jobs with needs: build-integration (the Integration Tests) to be skipped because Build Integration Bundle never completes in time.

Fix

Add a workflow-level concurrency group scoped to github.ref:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

This is per-PR — each PR's ref is unique (refs/pull/N/merge), so cancelling a stale run on PR #24 has no effect on PR #25.

Effect

When you push a new commit to a PR, any in-progress CI run for that PR is cancelled immediately, freeing the runner for the latest commit rather than waiting out the 24-hour timeout.

With a single self-hosted runner (penpot-runner-02) serving all jobs,
queued runs from an earlier push can block the runner for the full
24-hour workflow timeout — causing downstream jobs that need
build-integration to be skipped. Adding a per-ref concurrency group
ensures any in-progress run is cancelled when a new push arrives,
keeping the runner free for the latest commit.
Copilot AI review requested due to automatic review settings June 5, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to cancel stale GitHub Actions runs per PR to free the single self-hosted runner by introducing workflow-level concurrency with cancel-in-progress: true.

Changes:

  • Adds a top-level concurrency block scoped to ${{ github.workflow }}-${{ github.ref }} in the CI workflow.
  • (Unintended) Leaves an existing concurrency block in place, resulting in two concurrency: keys in the same workflow file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/tests.yml Outdated
Comment on lines +1 to +5
name: "CI"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
@AhtishamShahid

Copy link
Copy Markdown
Author

Closing — the workflow already has a concurrency block (cancel-in-progress: true scoped to PR number). My change introduced a duplicate which caused a YAML parse failure. The actual root cause of the skipped tests on PR #24 was penpot-runner-02 being offline for 24 hours, not a missing concurrency group.

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.

2 participants