@@ -108,14 +108,28 @@ jobs:
108108 with :
109109 fetch-depth : 0
110110
111+ - name : Restore vcpkg cache
112+ uses : actions/cache/restore@v4
113+ id : cache-restore
114+ with :
115+ path : ${{env.BUILD_DIR}}/cache.zip
116+ key : reusable-fast-windows
117+
118+ - name : Unpack vcpkg cache
119+ if : steps.cache-restore.outcome.cache-hit == 'true'
120+ run : Expand-Archive -Path ${{github.workspace}}/cache.zip -DestinationPath ${{env.BUILD_DIR}}/vcpkg -Force
121+ shell : pwsh
122+
111123 - name : Initialize vcpkg
124+ if : steps.cache-restore.outcome.cache-hit != 'true'
112125 uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
113126 with :
114127 vcpkgGitCommitId : ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
115128 vcpkgDirectory : ${{env.BUILD_DIR}}/vcpkg
116129 vcpkgJsonGlob : ' **/vcpkg.json'
117130
118131 - name : Install dependencies
132+ if : steps.cache-restore.outcome.cache-hit != 'true'
119133 run : vcpkg install --triplet x64-windows
120134 shell : pwsh # Specifies PowerShell as the shell for running the script.
121135
@@ -164,3 +178,16 @@ jobs:
164178 run : |
165179 get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list
166180 get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list
181+
182+ - name : Prepare vcpkg cache
183+ if : steps.cache-restore.outcome.cache-hit != 'true'
184+ run : |
185+ Compress-Archive -Path ${{env.BUILD_DIR}}/vcpkg -DestinationPath ${{github.workspace}}/cache.zip -Force -CompressionLevel Fastest
186+ # Get-ChildItem -Path ${{github.workspace}}
187+
188+ - name : Cache save
189+ if : steps.cache-restore.outcome.cache-hit != 'true'
190+ uses : actions/cache/save@v4
191+ with :
192+ path : ${{github.workspace}}/cache.zip
193+ key : reusable-fast-windows
0 commit comments