GitHub Actions in Action: Continuous integration and delivery for DevOps cover
welcome to this free extract from
an online version of the Manning book.
to read more
or

12 Improving workflow performance and costs

 

This chapter covers

  • Dealing with high-volume builds
  • Reducing the costs of maintaining artifacts
  • Improving performance

This short and final chapter of this book will share some insights into how you can improve the performance and costs of your GitHub Actions workflows. We will first look into how we can deal with repos with a high volume of commits that need to be merged. This can incur long wait times for the integration and high costs regarding the number of minutes of build time consumed. Next, we will look into some optimizations you can implement by reducing the cost of artifacts and improving the performance of your workflows by using concepts like caching and changing the runners you use. Let us get started with high-volume repos.

12.1 Dealing with high-volume builds

When you have a team of developers submitting code to the repository frequently using pull requests (PRs), you might have long wait times before your changes are accepted in the main branch. This is caused by the fact that jobs take a long time to complete, which will delay the feedback. You can use two approaches to deal with the number of builds becoming larger and getting slower feedback. One option is to use concurrency groups, and the other is to use merge queues. The next sections will describe this in further detail.

12.1.1 Concurrency groups

12.1.2 Merge queues

12.2 Reducing the costs of maintaining artifacts

12.3. Improving performance

12.3.1 Using a sparse checkout

12.3.2 Adding caching

12.3.3 Detecting a cache hit and skipping the work

12.3.4 Selecting other runners

12.4 Optimizing your jobs

Summary