-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Context
As identified in PR #89 review, the cache keys may not be sufficiently robust to all build changes.
Current Issue
Cache key only includes source files:
key: ccache-${{ matrix.compiler }}-${{ hashFiles('tol-master/tol/**/*.cpp', 'tol-master/tol/**/*.h') }}This misses changes to:
- CMakeLists.txt files
- .cmake configuration files
- Build scripts
- Dependency specifications
Proposed Solution
Enhanced Cache Key
key: ccache-${{ matrix.compiler }}-${{ hashFiles('tol-master/tol/**/*.cpp', 'tol-master/tol/**/*.h', 'tol-master/tol/CMakeLists.txt', 'tol-master/tol/**/*.cmake', 'tol-master/tol/**/CMakeLists.txt') }}Additional Improvements
- Version cache keys: Add version prefix for breaking changes
- Include compiler version: Add compiler version to key
- Build type differentiation: Separate Debug/Release caches
- Dependency tracking: Include dependency version info
Implementation
env:
CACHE_VERSION: v1 # Increment for cache-breaking changes
key: |
${{ env.CACHE_VERSION }}-
ccache-
${{ matrix.compiler }}-
${{ matrix.build_type }}-
${{ hashFiles('**/CMakeLists.txt', '**/*.cmake', '**/*.cpp', '**/*.h') }}Benefits
- Proper cache invalidation on build system changes
- Prevents stale cache issues
- Better build reproducibility
- Reduced mysterious build failures
Related: PR #89
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request