Skip to content

Use rust-cache instead of actions/cache for better CI performance #60

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

Merged
merged 1 commit into from
Mar 30, 2025

Conversation

TaKO8Ki
Copy link
Contributor

@TaKO8Ki TaKO8Ki commented Mar 29, 2025

Replace actions/cache with rust-cache

Motivation and Context

rust-cache (https://github.com/Swatinem/rust-cache) not only caches necessary files and directories such as ~/.cargo and target, but also removes unused dependencies before caching. Additionally, it disables incremental compilation CARGO_INCREMENTAL=0, which is unnecessary for CI environments.

rust-cache is used in large Rust open-source software projects such as axum and others.
ref: https://github.com/tokio-rs/axum/blob/cd2d5e1417e82b6fdc69c84847e438d9b37cd6a2/.github/workflows/CI.yml#L21

I confirmed that rust-cache works in an empty commit, which was removed.

... Restoring cache ...
Cache hit for: v0-rust-test-Linux-x64-c733e78c-c821e4bd
Received 134217728 of 288542975 (46.5%), 127.5 MBs/sec
Received 288542975 of 288542975 (100.0%), 153.9 MBs/sec
Cache Size: ~275 MB (288542975 B)

With caching, the execution time of the "Rust tests" job has been reduced from 1m 54s (without cache) to 1m 16s (with cache).

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@TaKO8Ki TaKO8Ki force-pushed the use-rust-cache branch 2 times, most recently from 46d4bdc to 57579fd Compare March 29, 2025 13:44
@4t145 4t145 requested a review from jokemanfire March 29, 2025 16:30
Copy link
Collaborator

@jokemanfire jokemanfire 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.

@jokemanfire jokemanfire merged commit cc3f299 into modelcontextprotocol:main Mar 30, 2025
10 checks passed
@jokemanfire
Copy link
Collaborator

#49

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.

2 participants