Support multiple benchmark packages per macOS workflow invocation#3602
Open
rnro wants to merge 3 commits into
Open
Support multiple benchmark packages per macOS workflow invocation#3602rnro wants to merge 3 commits into
rnro wants to merge 3 commits into
Conversation
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. * There was no way to consolidate multiple packages into a single workflow call. 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.
This reverts commit d09fc89.
FranzBusch
approved these changes
May 21, 2026
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_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
benchmark_package_pathsinput to.github/workflows/macos_benchmarks.ymland mark the singularbenchmark_package_pathas deprecated. The run step forwards both inputs straight to the script viaBENCHMARK_PACKAGE_PATHandBENCHMARK_PACKAGE_PATHSenvironment variables; the workflow itself does no path parsing.scripts/check_benchmark_thresholds.shto acceptBENCHMARK_PACKAGE_PATHSas either a JSON array of strings (auto-detected by a leading[, requiresjq) or a newline-separated list, falling back to the legacyBENCHMARK_PACKAGE_PATHwhen unset or when the JSON form is an empty array.::group::, and emits an::error::summary listing failed packages at the end, exiting non-zero if any failed.Result
benchmarks.yml) can pick up multi-package support by passingBENCHMARK_PACKAGE_PATHSwithout reimplementing parsing or failure-collection logic.An example of this working apple/swift-log#466