Adopt multi-package macOS benchmarks workflow#466
Merged
Conversation
rnro
force-pushed
the
single_benchmarks_job
branch
from
May 20, 2026 20:35
1c748d2 to
fc54526
Compare
rnro
added a commit
to apple/swift-nio
that referenced
this pull request
May 21, 2026
) ### Motivation * External callers of `macos_benchmarks.yml` (e.g. swift-log) currently invoke the reusable workflow once per benchmark package, paying self-hosted macOS runner-recycling cost for each invocation. ### Modifications * Add a new `benchmark_package_paths` input to `.github/workflows/macos_benchmarks.yml` and mark the singular `benchmark_package_path` as deprecated. The run step forwards both inputs straight to the script via `BENCHMARK_PACKAGE_PATH` and `BENCHMARK_PACKAGE_PATHS` environment variables; the workflow itself does no path parsing. * Teach `scripts/check_benchmark_thresholds.sh` to accept `BENCHMARK_PACKAGE_PATHS` as either a JSON array of strings (auto-detected by a leading `[`, requires `jq`) or a newline-separated list, falling back to the legacy `BENCHMARK_PACKAGE_PATH` when unset or when the JSON form is an empty array. * The script now loops over the resolved package list, wraps each iteration in a GitHub Actions `::group::`, and emits an `::error::` summary listing failed packages at the end, exiting non-zero if any failed. ### Result * A single workflow invocation runs all listed packages serially on each Swift/Xcode runner, paying runner-recycling cost once per Swift version instead of once per (version x package). * Existing single-package callers keep working unchanged. * Adopters of the script in other contexts (e.g. the Linux `benchmarks.yml`) can pick up multi-package support by passing `BENCHMARK_PACKAGE_PATHS` without reimplementing parsing or failure-collection logic. An example of this working apple/swift-log#466
Motivation * The current pattern chains a separate `macos-benchmarks-*` workflow invocation per package (`NoTraits`, `MaxLogLevelWarning`, `MaxLogLevelNone`), allocating one self-hosted macOS runner per (Swift version x package) and paying runner-recycling cost for each. * `apple/swift-nio`'s `macos_benchmarks.yml` now exposes a `benchmark_package_paths` input that runs multiple packages serially on a single runner allocation per Swift version. Modifications * Replace the three macOS benchmark jobs in `main.yml` and `pull_request.yml` with a single consolidated job using `benchmark_package_paths: '["Benchmarks/NoTraits", "Benchmarks/MaxLogLevelWarning", "Benchmarks/MaxLogLevelNone"]'`. * Drop Swift 6.2 from the matrix; only Swift 6.3 is shared between all three packages (`MaxLogLevelWarning` and `MaxLogLevelNone` have no `Thresholds/Xcode swift 6.2/`). Result * One macOS runner allocation per Swift version instead of one per (version x package). * `NoTraits` loses Swift 6.2 coverage; revisit once the other packages gain `Xcode swift 6.2` thresholds or 6.2 is dropped repo-wide.
rnro
force-pushed
the
single_benchmarks_job
branch
from
May 21, 2026 13:19
fc54526 to
58c1c8a
Compare
rnro
marked this pull request as ready for review
May 21, 2026 14:00
kukushechkin
approved these changes
May 21, 2026
rnro
enabled auto-merge (squash)
May 21, 2026 14:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
macos-benchmarksandmacos-benchmarks-MaxLogLevelWarningBenchmarks-traitallocates one self-hosted macOS runner per (Swift version x package), incurring duplicate runner-recycling cost.benchmark_package_pathsinput letting a single invocation run all packages serially on each runner.Modifications
main.ymlandpull_request.ymlwith a single consolidated job that passes both packages viabenchmark_package_paths: '["Benchmarks/NoTraits", "Benchmarks/MaxLogLevelWarning"]'.MaxLogLevelWarninghas noThresholds/Xcode swift 6.2/).Result
NoTraitsloses Swift 6.2 coverage