Skip to content

ci: optimize build times with shared caching and streamlined workflows#43

Merged
beinan merged 1 commit intolance-format:mainfrom
beinan:ci/optimize-build-caching
Mar 4, 2026
Merged

ci: optimize build times with shared caching and streamlined workflows#43
beinan merged 1 commit intolance-format:mainfrom
beinan:ci/optimize-build-caching

Conversation

@beinan
Copy link
Copy Markdown
Collaborator

@beinan beinan commented Mar 4, 2026

Summary

Apply learnings from lance-graph#143 to dramatically improve CI performance. That PR achieved a 74% speedup (24min → 6min) in Python tests through better caching and eliminating duplicate builds.

Changes

1. Shared Rust Cache Across All Workflows ⭐

  • Switched from manual cache@v4 to Swatinem/rust-cache@v2
  • Added shared-key: "lance-context-deps" to all workflows
  • Impact: Prevents duplicate compilation of Rust dependencies across Python, Rust, and Style workflows
  • Cache is now shared across all jobs instead of being isolated

2. Remove Nightly from Test Matrix

  • Only test on stable toolchain (matches upstream lance project)
  • Impact: ~50% reduction in Rust test time, prevents nightly breakage from blocking PRs
  • Stable is the primary deployment target

3. Standardize CARGO_INCREMENTAL=0

  • Added to python-test.yml (was missing)
  • Added to style.yml (was missing)
  • Already present in rust-test.yml
  • Impact: Consistent CI environment, no wasted incremental compilation artifacts

4. Optimized Cache Configuration

  • Removed CARGO_TARGET_DIR override (rust-cache handles this better)
  • Standardized workspaces across all workflows to include both crates/lance-context-core and python
  • Impact: Better cache hit rates and management

Expected Performance Impact

Based on the improvements seen in lance-graph:

  • ✅ Reduced duplicate Rust compilations via shared cache key
  • ✅ Faster CI runs with streamlined test matrix
  • ✅ Better cache efficiency with rust-cache action
  • ✅ Consistent build environment across all workflows

Test Plan

  • All workflow files updated consistently
  • Verify CI passes with new caching strategy
  • Monitor CI times to confirm performance improvement

🤖 Generated with Claude Code

Apply learnings from lance-graph#143 to dramatically improve CI performance:

1. Shared Rust Cache - Use rust-cache@v2 with shared-key across all workflows
   to prevent duplicate compilation of dependencies

2. Remove Nightly Toolchain - Test only on stable to reduce CI time by ~50%
   and prevent nightly breakage from blocking PRs

3. Standardize CARGO_INCREMENTAL=0 - Add to all workflows for consistent
   CI environment and avoid wasted incremental artifacts

4. Remove CARGO_TARGET_DIR - Let rust-cache handle target directory
   management for better cache efficiency

Expected impact: Faster builds through shared dependency cache, reduced
test matrix, and optimized caching strategy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@beinan beinan merged commit 0ba80e5 into lance-format:main Mar 4, 2026
7 checks passed
@beinan beinan deleted the ci/optimize-build-caching branch March 4, 2026 20:21
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.

1 participant