File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,14 @@ jobs:
20
20
uses : actions/cache@v3
21
21
id : cache-vcpkg
22
22
with :
23
- path : build/vcpkg_installed /
24
- key : vcpkg-x64-osx
23
+ path : build/vcpkg_cache /
24
+ key : vcpkg-binaries- x64-osx
25
25
26
26
- name : Create Build Environment
27
27
if : ${{ !steps.cache-vcpkg.outputs.cache-hit }}
28
- run : cmake -E make_directory build
28
+ run : |
29
+ cmake -E make_directory build
30
+ cmake -E make_directory build/vcpkg_cache
29
31
30
32
- name : Configure
31
33
shell : pwsh
34
36
$vcpkgToolchain = Join-Path $env:VCPKG_INSTALLATION_ROOT './scripts/buildsystems/vcpkg.cmake' -Resolve
35
37
$cmakeBuildType = '${{ matrix.config }}'
36
38
39
+ $cachedBinaries = Join-Path $(Get-Location) './vcpkg_cache/' -Resolve
40
+ $cacheAccess = $(if ('${{ steps.cache-vcpkg.outputs.cache-hit }}' -eq 'true') { 'read' } else { 'write' })
41
+ $env:VCPKG_BINARY_SOURCES = "clear;files,$cachedBinaries,$cacheAccess"
42
+
37
43
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DCMAKE_BUILD_TYPE=$cmakeBuildType" ${{ github.workspace }}
38
44
39
45
- name : Build
Original file line number Diff line number Diff line change @@ -27,12 +27,14 @@ jobs:
27
27
uses : actions/cache@v3
28
28
id : cache-vcpkg
29
29
with :
30
- path : build/vcpkg_installed /
31
- key : vcpkg-${{ steps.set-variables.outputs.vcpkg_triplet }}
30
+ path : build/vcpkg_cache /
31
+ key : vcpkg-binaries- ${{ steps.set-variables.outputs.vcpkg_triplet }}
32
32
33
33
- name : Create Build Environment
34
34
if : ${{ !steps.cache-vcpkg.outputs.cache-hit }}
35
- run : cmake -E make_directory build
35
+ run : |
36
+ cmake -E make_directory build
37
+ cmake -E make_directory build/vcpkg_cache
36
38
37
39
- name : Configure
38
40
shell : pwsh
43
45
$cmakeSharedLibs = $(if ('${{ matrix.libs }}' -eq 'shared') { 'ON' } else { 'OFF' })
44
46
$msbuildArch = $(if ('${{ matrix.arch }}' -eq 'x64') { 'X64' } else { 'Win32' })
45
47
48
+ $cachedBinaries = Join-Path $(Get-Location) './vcpkg_cache/' -Resolve
49
+ $cacheAccess = $(if ('${{ steps.cache-vcpkg.outputs.cache-hit }}' -eq 'true') { 'read' } else { 'write' })
50
+ $env:VCPKG_BINARY_SOURCES = "clear;files,$cachedBinaries,$cacheAccess"
51
+
46
52
cmake "-DCMAKE_TOOLCHAIN_FILE=$vcpkgToolchain" "-DVCPKG_TARGET_TRIPLET=$vcpkgTriplet" "-DBUILD_SHARED_LIBS=$cmakeSharedLibs" -G "Visual Studio 17 2022" -A "$msbuildArch" ${{ github.workspace }}
47
53
48
54
- name : Build
You can’t perform that action at this time.
0 commit comments