[CI ENERGY WASTE]:Optimize CI workflow by eliminating redundant setup steps #31383
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.
Change context
The CI workflow did run for more than 16k min for the past year only. The job runs can be optimized by reducing redundancy in steps across jobs. For instance, Node is being installed 5 times (once in each separate job: lint, unit, circular, e2e, e2e-cov). These redundant steps (checkouts, installations of dependencies) can take up to almost 1min of run.
Change details
After optimization, Node is installed 2 times (once in the combined test job, once in the e2e job).
The changes are as fellows:
A result of the run can be found here: https://github.com/mrdoob/three.js/actions/runs/16122945642/usage
It reduces at least 1min of run time compared to the previous runs with the old configuration structure
Additional context
We are a team of researchers from University of Zurich (https://www.ifi.uzh.ch/en/zest.html) currently working on automating energy optimizations in GitHub Actions workflows. This optimization maintains full functionality while reducing computational overhead and energy consumption.
[email protected]