Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(devops): Make GH Actions workflows run faster #517

Merged
merged 4 commits into from
Jun 1, 2022

Conversation

NibiruHeisenberg
Copy link
Contributor

@NibiruHeisenberg NibiruHeisenberg commented Jun 1, 2022

The unit-tests.yml and all-tests.yml have similar runtimes in GitHub Actions due to a heavy build process. The build process takes a long time because it's fetching Go modules due to running in a clean Linux environment.

This PR reduces Actions CPU time by doing the following:

  • add Go module caching (not nibid binary caching, as we want a fresh binary every time we run the tests) so that the workflow will complete faster
  • remove the make build step since go test ./... implicitly does a build. make build was just adding unnecessary CPU time (~2min per run).

The image below shows how make build adds an unnecessary 2 minutes per workflow run.
Screen Shot 2022-05-31 at 10 46 34 PM

The image below shows caching working (go packages and modules are found from the cache).
Screen Shot 2022-05-31 at 10 48 28 PM

Overall the unit test runtime dropped by ~20s and the billable time dropped by 2 minutes (40%).
Screen Shot 2022-05-31 at 10 53 42 PM
VS
Screen Shot 2022-05-31 at 10 52 12 PM

@NibiruHeisenberg NibiruHeisenberg requested a review from a team as a code owner June 1, 2022 05:43
@NibiruHeisenberg NibiruHeisenberg self-assigned this Jun 1, 2022
@NibiruHeisenberg NibiruHeisenberg changed the title chore(devops): Add caching to build and test workflows chore(devops): Make GH Actions workflows run faster Jun 1, 2022
@Unique-Divine Unique-Divine merged commit f7f54bd into master Jun 1, 2022
@Unique-Divine Unique-Divine deleted the chore/devops/workflow-caching branch June 1, 2022 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants