From ff5950529d8884b46aa5213adc125583a5584cff Mon Sep 17 00:00:00 2001 From: Roman Mazur Date: Fri, 15 May 2026 11:24:51 +0200 Subject: [PATCH] ci: cache cargo registry and target dir with Swatinem/rust-cache All three CI jobs currently rebuild every dependency from scratch on every run, which dominates CI time. Add Swatinem/rust-cache@v2 right after each Rust toolchain install so the cargo registry, git index, and target directory are restored from the per-job cache. The action keys the cache off Cargo.lock + toolchain by default, so: - cache hits skip the dependency compile entirely - Cargo.lock or toolchain changes invalidate cleanly - per-job key isolation means the rust/lit/coverage jobs each get the cache layout that matches their build profile Drop-in change: no scripts modified, no flags changed. Cold-cache runs behave the same; subsequent runs should drop from minutes of dep compile to seconds of restore. --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 485b832a..000590e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,8 @@ jobs: rustup toolchain install stable --profile minimal --component clippy,rustfmt rustup default stable + - uses: Swatinem/rust-cache@v2 + - name: Check formatting run: cargo fmt --all -- --check @@ -78,6 +80,8 @@ jobs: rustup toolchain install stable --profile minimal rustup default stable + - uses: Swatinem/rust-cache@v2 + - name: Build Rust binaries run: cargo build --bin soldb --bin soldb-dap-server @@ -121,6 +125,8 @@ jobs: rustup toolchain install stable --profile minimal rustup default stable + - uses: Swatinem/rust-cache@v2 + - name: Install Rust coverage tool run: cargo install cargo-llvm-cov --locked