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

ci: Cache dependencies to speed up test runs #2732

Merged

Conversation

shahzadlone
Copy link
Member

@shahzadlone shahzadlone commented Jun 17, 2024

Relevant issue(s)

Resolves #2735

Description

In this PR we cache go and rust build/dep states, and restore them if an action run has same dependency graph. Go cache is around 877 MB and cargo/rust cache is about 189MB (99MB for macos) so we can roughly have room for 5 caches (x1 for linux and x1 for macos) before a cache is dropped / lost.

Notes:

  • Github gives us 10GB of cache storage by default.
  • Rather than going with the standard practice of using lockfiles to generate the caching key we will use the mod and toml files, in order to maximize cache hits. Incase troublesome we can go back to lockfiles.
  • This change does not help the change detector. IMO change detector should move to a separate job, or a new workflow file. (opened split change detector action into a separate job, or a separate workflow completely #2736)

Demo

How has this been tested?

  • Manual
  • act tool

@shahzadlone shahzadlone added ci/build This is issue is about the build or CI system, and the administration of it. DO NOT MERGE labels Jun 17, 2024
@shahzadlone shahzadlone self-assigned this Jun 17, 2024
@shahzadlone shahzadlone force-pushed the lone/cache-test-builds branch from b0ae02a to de74c23 Compare June 17, 2024 19:21
Copy link

codecov bot commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.11%. Comparing base (38f9b9f) to head (d9f54c3).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2732      +/-   ##
===========================================
- Coverage    78.12%   78.11%   -0.01%     
===========================================
  Files          310      310              
  Lines        23188    23188              
===========================================
- Hits         18115    18112       -3     
- Misses        3693     3694       +1     
- Partials      1380     1382       +2     
Flag Coverage Δ
all-tests 78.11% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38f9b9f...d9f54c3. Read the comment docs.

@shahzadlone shahzadlone force-pushed the lone/cache-test-builds branch 5 times, most recently from 34e09cb to 0706229 Compare June 17, 2024 21:41
@shahzadlone shahzadlone changed the title ci: Cache go and cargo dependencies [DONT REVIEW] ci: Cache dependencies to speed up test runs Jun 17, 2024
@shahzadlone shahzadlone marked this pull request as ready for review June 17, 2024 22:18
@shahzadlone shahzadlone requested a review from a team June 17, 2024 22:18
@shahzadlone shahzadlone force-pushed the lone/cache-test-builds branch from 0706229 to d9f54c3 Compare June 17, 2024 22:25
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks a whole load for this Shahzad :)

@shahzadlone shahzadlone merged commit 3c0a14a into sourcenetwork:develop Jun 18, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/build This is issue is about the build or CI system, and the administration of it.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If no dependencies have changes cache build state for faster action run
2 participants