workflows: use dynamic parallelism for CI#566
Merged
jmr merged 1 commit intogoogle:masterfrom Apr 17, 2026
Merged
Conversation
ca023bd to
44f1ada
Compare
Improve parallelism in CI by dynamically determining the core count
with `getconf`. This replaces hardcoded job limits and allows the
builds to adapt to the runner size. Additionally, switch to calling
ctest directly, which is simpler.
- Add a "Set NUM_CORES" step in the CMake job using `getconf` and
print the detected core count to the workflow output.
- Use `${{ env.NUM_CORES }}` for CMake build parallelism.
- Run tests using `ctest --parallel ${{ env.NUM_CORES }}` directly
instead of `cmake --build . --target=test`.
- Remove explicit job counts from Bazel, allowing it to use its
native auto-detection.
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.
Replace hardcoded parallel job counts with dynamic CPU detection across CMake, CTest, and Bazel. This prevents resource exhaustion and "missing executable" linking failures on runners with fewer than 45 cores (notably macOS Intel runners).
--parallel 45with--parallelin CMake build steps.CTEST_PARALLEL_LEVEL: 45to allow CTest to scale automatically based on the build's parallel settings.--jobs=45from the Bazel test command to let Bazel auto-detect the runner's CPU count.