Skip to content

Optimize caching in CI #85

@joshlf

Description

@joshlf

In CI, we use the Swatinem/rust-cache GitHub Action to cache certain build artifacts across runs. However, it seems from the README that we might be using it in a suboptimal way. A few observations:

  • Zerocopy has only one dependency, and rust-cache only caches dependencies, not crate artifacts (note that zerocopy-derive has more dependencies - and dependencies that are expensive to compile - so presumably benefits much more than zerocopy)
  • We generate a custom cache key which includes:
    • A hash of the Cargo features, but this presumably shouldn't have any effect on dependencies (at least in our case, since none of our Cargo features depend on dependencies' Cargo features)
    • A hash of **/Cargo.lock, but this is documented to be the default behavior anyway

We should:

  • Figure out if there's a way to squeeze more benefit out for zerocopy (can we get rust-cache to cache any more artifacts?)
  • Don't include Cargo features in the cache
  • Don't include a hash of **/Cargo.lock in the cache
  • Go back over our use of rust-cache and its README with a fine toothed comb and see what else we're doing suboptimally

cc @Swatinem in case there's anything obvious that jumps out at you!

Metadata

Metadata

Assignees

Labels

experience-mediumThis issue is of medium difficulty, and requires some experiencegood first issueGood for newcomers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions