Skip to content

Conversation

@lnbc1QWFyb24
Copy link
Collaborator

@lnbc1QWFyb24 lnbc1QWFyb24 commented Jul 30, 2025

Summary

This PR introduces improvements to the build and CI/CD pipeline by implementing better caching strategies and optimizing the Docker build process. These changes will reduce build times and improve resource utilization across both GitHub Actions workflows and Docker builds.

Changes

GitHub Actions Improvements

  • Replaced manual cargo caching with Swatinem/rust-cache: The workflows now use a specialized Rust caching action that provides more intelligent and efficient caching compared to the previous manual approach
  • Enabled failure-resilient caching: Set cache-on-failure: "true" to preserve cache even when builds fail, preventing unnecessary cache rebuilds
  • Disabled target caching: Set cache-targets: "false" to focus on dependency caching rather than build artifacts

Docker Build Optimization

  • Implemented multi-stage build with cargo-chef: The Dockerfile now uses cargo-chef to create cacheable layers for dependencies, significantly reducing rebuild times when only source code changes
  • Optimized runtime image: Switched from debian:bookworm to debian:bookworm-slim for a smaller final image size
  • Removed BuildKit cache mounts: Replaced with cargo-chef's layer-based caching approach for better Docker layer reusability

Code Formatting

  • Minor formatting improvement in src/interrupts.rs for cargo fmt

- Replace manual cargo caching with Swatinem/rust-cache action in CI workflows
- Implement multi-stage Docker build with cargo-chef for better layer caching
- Enable cache-on-failure to preserve cache even on build failures
- Streamline Dockerfile to use bookworm-slim for smaller runtime image
- Minor code formatting fix in interrupts.rs
The dist tool manages its own release workflow and requires the file to match
its expected format. Custom caching additions cause validation failures.
@lnbc1QWFyb24 lnbc1QWFyb24 merged commit eadd554 into main Jul 30, 2025
6 checks passed
@lnbc1QWFyb24 lnbc1QWFyb24 deleted the enh/cache-builds branch July 30, 2025 14:02
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