Split Viewer and Test builds into separate jobs in GHA to reduce potential for disk space exhaustion#5168
Conversation
There was a problem hiding this comment.
Pull request overview
This PR splits Viewer and Test builds into separate GitHub Actions matrix jobs to mitigate disk space exhaustion issues. The changes introduce a new build_variant matrix dimension with values Viewer and Tests, and modify the build script to handle test execution separately from viewer builds.
Key Changes
- Added a
build_variantmatrix dimension to create separate job instances for Viewer and Tests builds - Modified
build.shto support abuild_testsmode that only builds and runs tests, skipping viewer-specific build steps - Adjusted artifact upload conditions to only run for Viewer builds, as test builds don't produce viewer artifacts
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/build.yaml |
Added build_variant matrix dimension, updated environment variables to conditionally set build_viewer and build_tests, modified artifact upload conditions to only run for Viewer builds, updated cache keys to include build variant, removed macOS disk cleanup, and restricted Linux disk cleanup to Viewer builds only |
build.sh |
Added TESTING variable initialization, added conditional logic to check build_tests flag and set TESTING=ON, modified build() function to handle test builds separately with BUILD_AND_RUN_TESTS target, removed inline ctest execution from viewer build path |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| matrix: | ||
| runner: ${{ fromJson((github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/Second_Life')) && '["windows-large","macos-15-xlarge","linux-large"]' || '["windows-2022","macos-15-xlarge","ubuntu-22.04"]') }} | ||
| configuration: ${{ fromJson(needs.setup.outputs.configurations) }} | ||
| build_variant: [Viewer, Tests] |
There was a problem hiding this comment.
Adding the build_variant matrix dimension creates multiple build job instances for each runner/configuration combination. This causes downstream jobs (sign-and-package-windows, sign-and-package-mac, post-windows-symbols, post-mac-symbols) to have ambiguous dependencies since they use "needs: build" but there are now multiple build jobs (Viewer and Tests).
The downstream jobs will fail because GitHub Actions cannot determine which build job output to use. Consider either:
- Adding a conditional to exclude the Tests variant from the matrix (e.g., using matrix.exclude)
- Filtering downstream jobs to only run for the Viewer variant
- Separating the build job outputs for Viewer vs Tests variants
There was a problem hiding this comment.
I'm not sure copilot is correct about causing the downstream jobs to fail. The build job only outputs artifacts when running the Viewer variant and I've been using an extremely similar build.yaml in alchemy for nearly a year.
…ntial for disk space exhaustion Signed-off-by: Rye <rye@alchemyviewer.org>
2af6db2 to
d32ced4
Compare
Description
Splits Viewer and Test builds into separate jobs in GHA to reduce potential for disk space exhaustion
Related Issues
Issue Link: #4677
Checklist
Please ensure the following before requesting review:
Additional Notes