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

Improved and expanded Rust examples #325

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

mzabaluev
Copy link

  • Avoid caching redundant data.
  • Demonstrate how to share cached dependency downloads across build jobs in a multi-OS matrix.
  • A recipe for testing libraries that do not have Cargo.lock checked in.

@mzabaluev mzabaluev force-pushed the improve-rust-example branch 3 times, most recently from 2892b5c to 53922e1 Compare June 13, 2020 04:20
@mzabaluev
Copy link
Author

I have updated the examples to actions/cache@v2.

The registry filesystem format and the git repositories work
across platforms, no need to maintain runner-specific
caches for these.
As the packed crate sources are stored under ~/.cargo/registry/cache,
it's redundant to archive the unpacked sources.

The sufficient local state of the git dependencies is in
~/.cargo/git/db. Cargo automatically checks out the source
trees if missing.
@mzabaluev mzabaluev force-pushed the improve-rust-example branch from 53922e1 to f4aba46 Compare June 18, 2020 01:30
This example could be used by projects that build Rust
end product crates on an OS matrix, but share the cargo cache.
To avoid fetching the dependencies from the network in
each matrix job in case of a cache miss, a dedicated job
pre-populates the cache on Linux, to be reused by the
jobs in the matrix.

Also demonstrate separate proximate caching of the registry index.
No Cargo.lock in the checkout, so the workflow has to
generate it first.
This speeds up builds unless the target directory is
also cached. Conveniently, the simple example which
features such caching omits the build step.
@matu3ba
Copy link

matu3ba commented May 11, 2021

Examples are intended to be minimal as you can see from other languages. Please make another repo to include them there, because github will likely not maintain big examples.

@vsvipul vsvipul changed the base branch from master to main March 21, 2022 05:24
@vsvipul vsvipul requested a review from a team as a code owner March 21, 2022 05:24
@vsvipul vsvipul requested a review from aparna-ravindra May 11, 2022 09:43
@pallavx pallavx assigned pallavx and unassigned aparna-ravindra Aug 17, 2022
@pallavx pallavx added the documentation Improvements or additions to documentation label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants