1) Review Job Placement
Job order can often be the largest impact on workflow duration. Review the workflow for opportunities to run jobs in parallel and note which jobs are bottlenecking the workflow to review them for improvement opportunities.
If several jobs are running in parallel, ensuring they run for similar durations, if possible, is also important in keeping an efficient workflow.
This is due to the workflow duration being defined by the last running job. As such, ensuring you have no long-running outliers will reduce your overall workflow duration
Placing shorter jobs, like linters, in the beginning of the workflow is helpful in reducing the time to receive feedback about a change being tested. This saves credits and time as a large portion of the workflow doesn’t need to run to receive feedback about a small issue.
2) Identify Modular Configuration Opportunities
When reviewing workflows that fan out but never fan back in, see if the jobs could be grouped into separate workflows. Having multiple workflows provides the separation needed to take advantage of dynamic config, which allows workflows to be triggered based on parameters set in a setup workflow. Workflows and jobs can then be conditionally run, saving time and credits.
Creating parameterized jobs allows for further implementation of dynamic config and leads to an easier to manage config in most cases. Those jobs can also be used to create matrix jobs.
Next Step: High Level Improvement Opportunities
Comments
Article is closed for comments.