Skip to content

Fix vcpkg cache paths for Linux and macOS#43

Merged
asfernandes merged 1 commit into
asfernandes:mainfrom
fdcastel:fix-gh-actions-cache
Mar 11, 2026
Merged

Fix vcpkg cache paths for Linux and macOS#43
asfernandes merged 1 commit into
asfernandes:mainfrom
fdcastel:fix-gh-actions-cache

Conversation

@fdcastel
Copy link
Copy Markdown
Contributor

Problem

The vcpkg cache paths in main.yml for Linux and macOS were set to build/Release/vcpkg_installed, but CMakePresets.json sets VCPKG_INSTALLED_DIR to build/vcpkg_installed (shared across all presets). This path mismatch meant the cache was saving/restoring the wrong directory, causing vcpkg to rebuild all ~60 packages from source on every run (~9 min).

Windows was already using the correct path (build/vcpkg_installed).

Additionally, pull-request.yml was missing vcpkg cache steps entirely for all three platforms.

Changes

  1. Fixed Linux and macOS cache paths from build/Release/vcpkg_installed to build/vcpkg_installed in main.yml
  2. Added missing vcpkg cache steps to pull-request.yml for all three platforms (Linux, Windows, macOS)
  3. Bumped cache key version to v3 to invalidate stale entries

Timing measurements

"Configure CMake" step (where vcpkg install runs)

Platform Before (broken cache) After (cache hit) Improvement
Linux 9m 40s 18s -9m 22s (97%)
macOS 8m 22s 1m 53s -6m 29s (78%)
Windows 19m 11s 42s -18m 29s (96%)

Total job time

Platform Before (broken cache) After (cache hit) Improvement
Linux 11m 47s 2m 14s -9m 33s (81%)
macOS 9m 56s 4m 00s -5m 56s (60%)
Windows 23m 19s 5m 07s -18m 12s (78%)

Workflow runs

- Fix Linux/macOS cache path from build/Release/vcpkg_installed to
  build/vcpkg_installed to match VCPKG_INSTALLED_DIR in CMakePresets.json
- Add missing vcpkg cache steps to pull-request.yml for all platforms
- Bump cache key version to v3 to invalidate stale entries
@asfernandes asfernandes merged commit 8e8a831 into asfernandes:main Mar 11, 2026
8 of 12 checks passed
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