Skip to content

ci: parallel Debian build and concurrency cancel for PRs#4056

Open
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:ci/concurrency-and-parallel
Open

ci: parallel Debian build and concurrency cancel for PRs#4056
grandixximo wants to merge 2 commits into
LinuxCNC:masterfrom
grandixximo:ci/concurrency-and-parallel

Conversation

@grandixximo
Copy link
Copy Markdown
Contributor

Two independent CI improvements split out of #4053 (asciidoctor docs migration) so they benefit every branch immediately.

1. Parallel Debian build

build-package-arch.sh and build-package-indep.sh now set DEB_BUILD_OPTIONS="parallel=$(nproc)". dh_auto_build honours this and passes -jN to make; without it debuild leaves the package build single-threaded. Local measurement on an 8-core box: the doc-only binary-indep build drops from ~32 min to ~7 min. The 4-CPU ubuntu-24.04 runners see proportional gains; expected ~3x on per-job wall time.

Applies the same change in both scripts so package-arch and package-indep matrix jobs both pick it up.

2. Concurrency cancel-in-progress

When a new push to a pull request lands, the prior in-flight run for that ref gets cancelled. Gated on pull_request events only:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

master / release / check_suite triggers are left alone, so a tagged release or a manually-rerequested check-suite never cancels itself.

Why split

Both pieces are general infrastructure useful for every branch and have no dependency on the docs migration. Splitting them out lets them merge ahead of #4053 and start helping immediately; #4053 will rebase to drop these changes once this lands.

Test plan

  • Confirm package-arch and package-indep jobs on this PR's CI run finish faster than the baseline (compare per-job timings against a recent master run).
  • After merge, push a second commit to a PR and confirm the older run gets cancelled.

debuild leaves dpkg-buildpackage in serial mode unless
DEB_BUILD_OPTIONS=parallel=N is in the environment.  dh_auto_build
honours that variable and translates it into make -jN, so opting in
fans out the C/C++ build and the per-language doc rules across all the
runner's CPUs.  Local measurement on an 8-core box: binary-indep wall
time 32 min -> 7 min for the doc-only stage.

build-doc.sh already passes -j directly to make; this matches that
behaviour for the deb package CI jobs.
Add a concurrency block keyed on workflow + ref so a fresh push to a pull request automatically cancels any still-running prior run for that ref. cancel-in-progress is gated on the pull_request event, so master / release / check_suite triggers are left alone (they should never cancel themselves).
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.

1 participant