Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR modernizes Rust dependency caching across all GitHub workflows by replacing manual actions/cache configurations with Swatinem/rust-cache@v2, which provides specialized optimizations for Rust builds—specifically avoiding caching of incremental build artifacts while focusing on compiled dependencies.
Key changes:
- Replaces verbose manual cache configurations with concise
Swatinem/rust-cache@v2usage - Adds custom cache keys for cross-compilation targets (linux, intel, windows)
- Updates action version pins in bundle-desktop-linux.yml for consistency
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/pr-smoke-test.yml | Switches from manual cache setup to rust-cache action |
| .github/workflows/ci.yml | Switches from manual cache setup to rust-cache action |
| .github/workflows/bundle-desktop.yml | Switches from three separate cache steps to single rust-cache action |
| .github/workflows/bundle-desktop-windows.yml | Switches from two manual cache steps to rust-cache with custom key |
| .github/workflows/bundle-desktop-linux.yml | Switches to rust-cache with SHA pin and updates artifact upload action pins |
| .github/workflows/bundle-desktop-intel.yml | Switches from three separate cache steps to rust-cache with SHA pin |
| .github/workflows/build-cli.yml | Consolidates separate Windows and Linux/macOS cache steps into unified rust-cache usage |
| restore-keys: | | ||
| ${{ runner.os }}-cargo-release- | ||
| - name: Cache Rust dependencies | ||
| uses: Swatinem/rust-cache@v2 |
There was a problem hiding this comment.
Inconsistent version pinning: some workflows pin to SHA 98c8021b550208e191a6a3145459bfc9fb29c4c0 while this uses @v2. Use the same pinned SHA across all workflows for consistency and security.
| uses: Swatinem/rust-cache@v2 | |
| uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # pin@v2 |
| key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-cargo-debug- | ||
| uses: Swatinem/rust-cache@v2 |
There was a problem hiding this comment.
Inconsistent version pinning: some workflows pin to SHA 98c8021b550208e191a6a3145459bfc9fb29c4c0 while this uses @v2. Use the same pinned SHA across all workflows for consistency and security.
| uses: Swatinem/rust-cache@v2 | |
| uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # pin@v2 |
| restore-keys: | | ||
| ${{ runner.os }}-cargo-build-release- | ||
| - name: Cache Rust dependencies | ||
| uses: Swatinem/rust-cache@v2 |
There was a problem hiding this comment.
Inconsistent version pinning: some workflows pin to SHA 98c8021b550208e191a6a3145459bfc9fb29c4c0 while this uses @v2. Use the same pinned SHA across all workflows for consistency and security.
| uses: Swatinem/rust-cache@v2 | |
| uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 |
| uses: actions/cache@2f8e54208210a422b2efd51efaa6bd6d7ca8920f | ||
| # Cache Rust dependencies for Windows cross-compilation | ||
| - name: Cache Rust dependencies | ||
| uses: Swatinem/rust-cache@v2 |
There was a problem hiding this comment.
Inconsistent version pinning: some workflows pin to SHA 98c8021b550208e191a6a3145459bfc9fb29c4c0 while this uses @v2. Use the same pinned SHA across all workflows for consistency and security.
| uses: Swatinem/rust-cache@v2 | |
| uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # pin@v2 |
|
merged as part of #5702 |
This action does all sorts of optimizations that are useful to us. Our cache is way too big and most of it isn't useful (it caches a bunch of incremental build artifacts from our own code, when we really just want to cache compiled dependencies)