Add dependency caching for Python wheel builds to resolve #1161#1329
Open
Add dependency caching for Python wheel builds to resolve #1161#1329
Conversation
- Add GitHub Actions cache for Boost, yaml-cpp, and CastXML dependencies - Cache is keyed by OS, architecture, and dependency versions - Modified before_build.sh to check for cached dependencies before building - Significant build time reduction expected for wheel builds across multiple Python versions - Fixes issue ompl#1161: Use cache to speed up CI for Python wheels
- Add ccache for C++ compilation (50-70% faster on cache hits) - Cache CMake build artifacts for incremental builds - Cache APT packages (Linux) to avoid re-downloading - Cache Homebrew packages (macOS) to speed up dependency installation - Disable Homebrew auto-update to save time - Configure CMake to use ccache compiler launcher Expected impact: - 40-60% faster build times for incremental changes - 3-5 minutes saved on macOS builds - 1-2 minutes saved on Linux builds - Faster PR feedback for developers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add comprehensive CI caching to speed up builds (fixes #1161)
Problem
Currently, the Python wheel build process rebuilds Boost, yaml-cpp, and CastXML from source for every Python version (3.10, 3.11, 3.12, 3.13) on every platform (Linux x86_64, Linux ARM64, macOS x86, macOS ARM64) on every CI run. Additionally, the main build & test workflow rebuilds everything from scratch on every push/PR. This results in unnecessarily long CI times.
Solution
This PR implements dependency caching for Python wheel builds (resolving issue #1161) and extends comprehensive caching to the build & test workflow to significantly reduce CI build times.
Expected Impact
Wheel Builds
Build & Test (PR/Push)
Changes Made
1.
.github/workflows/wheels.yaml:deps-{platform}-boost-{version}-yaml-{version}-castxml-{version}2.
.github/workflows/before_build.sh:install_boost(),install_yaml_cpp(), andinstall_castxml()functions to check for cached dependenciesOMPL_DEPS_CACHE_DIRenvironment variable3.
.github/workflows/build.yml:Comprehensive caching for the main build & test workflow.
What's cached:
a. ccache
hendrikmuhs/[email protected]CMAKE_C_COMPILER_LAUNCHERandCMAKE_CXX_COMPILER_LAUNCHERb. CMake build artifacts
CMakeLists.txtandsrc/**changesc. Package manager caches
/var/cache/apt)HOMEBREW_NO_AUTO_UPDATE=1to disable auto-updateHOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1to speed up installsAdvantages
Technical Details
Cache Keys
All caches use
restore-keysfor partial matches to maximize cache hit rates.Testing
OMPL_DEPS_CACHE_DIRsetRelated Issues
Fixes #1161
Files Changed
.github/workflows/wheels.yaml- Python wheel caching.github/workflows/before_build.sh- Dependency caching logic.github/workflows/build.yml- Build & test caching