Skip to content

Commit 4fb2dae

Browse files
committed
ci(vcpkg): Override VCPKG_DEFAULT_BINARY_CACHE to use cached directory instead of temp dir
1 parent b878990 commit 4fb2dae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/build-toolchain.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ jobs:
115115
- name: Setup vcpkg
116116
uses: lukka/run-vcpkg@v11
117117

118+
- name: Force vcpkg binary cache directory
119+
shell: pwsh
120+
run: |
121+
# Override VCPKG_DEFAULT_BINARY_CACHE that lukka/run-vcpkg sets to its own temp dir
122+
# This ensures vcpkg uses our cached directory instead
123+
$cacheDir = "${{ github.workspace }}\vcpkg-bincache"
124+
"VCPKG_DEFAULT_BINARY_CACHE=$cacheDir" >> $env:GITHUB_ENV
125+
"VCPKG_BINARY_SOURCES=clear;files,$cacheDir,readwrite" >> $env:GITHUB_ENV
126+
Write-Host "Forced vcpkg binary cache to: $cacheDir" -ForegroundColor Cyan
127+
Write-Host "VCPKG_DEFAULT_BINARY_CACHE=$env:VCPKG_DEFAULT_BINARY_CACHE" -ForegroundColor Gray
128+
Write-Host "VCPKG_BINARY_SOURCES=$env:VCPKG_BINARY_SOURCES" -ForegroundColor Gray
129+
118130
- name: Configure ${{ inputs.game }} with CMake Using ${{ inputs.preset }}${{ inputs.tools && '+t' || '' }}${{ inputs.extras && '+e' || '' }} Preset
119131
shell: pwsh
120132
run: |

0 commit comments

Comments
 (0)