diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6855141..6af82fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,14 @@ on: pull_request: branches: [main] +concurrency: + # A new push to the same PR or branch supersedes the run in flight. Without + # this every push queued a *fresh* full set of jobs alongside the old ones, + # so a branch pushed five times held five complete matrices at once — on + # paid Blacksmith runners, and with nothing reclaiming the superseded work. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 @@ -14,6 +22,12 @@ jobs: test: name: Test runs-on: blacksmith-2vcpu-ubuntu-2404 + # Capped because the GitHub default is **six hours** per job, and this + # workflow is reachable from a fork pull request. Measured over the last + # six runs the slowest job here is 3m57s, so 20 minutes is roughly 5x + # headroom while removing the runaway: a stuck or hostile job now costs + # 20 minutes of a paid runner rather than a working day of one. + timeout-minutes: 20 steps: - uses: actions/checkout@v7 @@ -38,6 +52,7 @@ jobs: lint: name: Lint runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 20 steps: - uses: actions/checkout@v7 @@ -62,6 +77,7 @@ jobs: docs: name: Documentation runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 20 steps: - uses: actions/checkout@v7 @@ -87,6 +103,7 @@ jobs: msrv: name: MSRV (1.93) runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 20 steps: - uses: actions/checkout@v7 @@ -147,6 +164,7 @@ jobs: coverage: name: Coverage runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 20 steps: - uses: actions/checkout@v7 @@ -173,6 +191,7 @@ jobs: security: name: Security Audit runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 20 steps: - uses: actions/checkout@v7