@@ -41,17 +41,20 @@ jobs:
4141 - if : matrix.os == 'macos-latest' || matrix.os == 'macos-14'
4242 run : |
4343 brew install cgal
44- # Cache vcpkg on Windows
44+ # Cache vcpkg artifacts on Windows to avoid rebuilding dependencies every run
4545 - name : Restore vcpkg cache
4646 if : runner.os == 'Windows'
4747 id : cache-vcpkg
4848 uses : actions/cache@v4
4949 with :
5050 path : |
51- C:/vcpkg
52- key : vcpkg-${{ runner.os }}-${{ hashFiles('vcpkg.json') }}
51+ C:/vcpkg/installed
52+ C:/vcpkg/packages
53+ C:/vcpkg/downloads
54+ C:/vcpkg/buildtrees
55+ key : vcpkg-${{ runner.os }}-x64-windows-cgal-${{ hashFiles('.github/workflows/pypi.yml', 'CMakeLists.txt', 'pyproject.toml') }}
5356 restore-keys : |
54- vcpkg-${{ runner.os }}-
57+ vcpkg-${{ runner.os }}-x64-windows-cgal-
5558
5659 - name : Install vcpkg dependencies (Windows only)
5760 if : runner.os == 'Windows'
@@ -60,11 +63,13 @@ jobs:
6063 $Env:VCPKG_ROOT = "C:/vcpkg"
6164 if (!(Test-Path $Env:VCPKG_ROOT)) {
6265 git clone https://github.com/microsoft/vcpkg $Env:VCPKG_ROOT
63- & "$Env:VCPKG_ROOT/bootstrap-vcpkg.bat"
6466 }
65- # Only install if packages are missing
66- if (!(Test-Path "$Env:VCPKG_ROOT/installed/x64-windows/cgal")) {
67- & "$Env:VCPKG_ROOT/vcpkg.exe" install cgal
67+ if (!(Test-Path "$Env:VCPKG_ROOT/vcpkg.exe")) {
68+ & "$Env:VCPKG_ROOT/bootstrap-vcpkg.bat"
69+ }
70+ # Only install if CGAL is missing for the target triplet
71+ if (!(Test-Path "$Env:VCPKG_ROOT/installed/x64-windows/share/cgal")) {
72+ & "$Env:VCPKG_ROOT/vcpkg.exe" install cgal --triplet x64-windows
6873 }
6974 echo "VCPKG_ROOT=$Env:VCPKG_ROOT" >> $Env:GITHUB_ENV
7075 # now inject your extra CMake flags:
0 commit comments