Skip to content

ci/build: Skip heavy build matrix on draft pull requests - #3917

Merged
acassis merged 1 commit into
apache:masterfrom
Swatantra-66:ci/skip-build-on-draft
Oct 25, 2026
Merged

acassis merged 1 commit into
apache:masterfrom
Swatantra-66:ci/skip-build-on-draft

Conversation

@Swatantra-66

Copy link
Copy Markdown
Contributor

Summary

Companion to merged apache/nuttx#20973 (apache/nuttx@b63e526c91).

In response to the notice from ASF Infrastructure regarding excessive GitHub Actions runner consumption, this patch skips the heavy 80-container build matrix when a pull request is in Draft state:

  1. Adds types: [opened, synchronize, reopened, ready_for_review] to on.pull_request so GitHub Actions recognizes when a draft pull request is transitioned to ready for review.
  2. Adds if: github.event_name != 'pull_request' || github.event.pull_request.draft == false to Fetch-Source. Because all downstream matrix jobs (Linux, macOS, msys2, msvc) depend on Fetch-Source, skipping Fetch-Source cleanly cascades to skip all heavy build jobs on draft pull requests.
  3. Fast checks (check.yml and lint.yml) continue to run on draft pull requests to provide immediate code style and lint feedback within ~60 seconds without consuming heavy runner hours.
  4. Uses an explicit equality check (draft == false) to ensure empty/null payloads on fork PRs do not accidentally trigger the job.

Impact

Runner Savings - Prevents all 80 runner matrix jobs (Linux, Intel macOS, MSYS2 Windows, MSVC) from executing on draft / WIP pull requests in nuttx-apps.
Automatic Resume - When a contributor clicks "Ready for review", GitHub Actions automatically fires the ready_for_review event and executes the full build matrix.

Testing

Validated GitHub Actions workflow YAML syntax via yaml.safe_load.
Verified git diff --check passes with zero errors or whitespace issues.

In response to the ASF Infrastructure notice regarding excessive GitHub Actions runner consumption, skip the heavy build matrix when a pull request is in draft state.

Companion to apache/nuttx PR #20973. Fast checks (check.yml and lint.yml) continue to run to provide early style and syntax feedback. The full build matrix will automatically trigger once the PR is marked 'Ready for review'.

Signed-off-by: Swatantra Yadav <[email protected]>

@cederom cederom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @Swatantra-66 .. we may want complementary update on nuttx-apps repo when this is verified okay? :-)

@acassis
acassis merged commit 07c2041 into apache:master Oct 25, 2026
32 of 41 checks passed
@Swatantra-66

Swatantra-66 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you @Swatantra-66 .. we may want complementary update on nuttx-apps repo when this is verified okay? :-)

thank you for aproval @cederom, this PR is actually already on the nuttx-apps repository, The companion PR for core nuttx (apache/nuttx#20973) was also verified earlier. So both repositories now have the draft-skip optimization in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants