Skip to content

Commit b580a88

Browse files
committed
add qualifiers to cache key. move cahe directory out of build directory.
1 parent 2a63b80 commit b580a88

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/CI.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,24 @@ jobs:
4343
with:
4444
vcpkgJsonGlob: './deps/ziti-tunnel-sdk-c/vcpkg.json'
4545

46+
- name: get vcpkg cache key
47+
id: get_vcpkg_cache_key
48+
shell: bash
49+
env:
50+
KEY_PREFIX: vcpkg_cache-${{ matrix.spec.toolchain }}
51+
run: |
52+
common_key="${KEY_PREFIX}-vcpkg_json_md5=$(md5sum ./deps/ziti-tunnel-sdk-c/vcpkg.json | awk '{ print $1 }')"
53+
echo "key=${common_key}-ImageVersion=${ImageVersion}" | tee -a $GITHUB_OUTPUT
54+
4655
- uses: actions/cache@v5
4756
with:
48-
key: vcpkg_cache_${{ matrix.spec.name }}
49-
path: ./deps/ziti-tunnel-sdk-c/${{ matrix.spec.name }}/vcpkg_cache
57+
key: ${{ steps.get_vcpkg_cache_key.outputs.key }}
58+
path: ./deps/ziti-tunnel-sdk-c/${{ matrix.spec.toolchain }}/vcpkg_cache
5059

5160
- name: ${{ matrix.spec.name }}
5261
env:
5362
TOOLCHAIN: ${{ matrix.spec.toolchain && format('../../toolchains/{0}.cmake', matrix.spec.toolchain) || '' }}
54-
VCPKG_BINARY_SOURCES: "clear;files,/Users/runner/work/ziti-sdk-swift/ziti-sdk-swift/deps/ziti-tunnel-sdk-c/${{ matrix.spec.name }}/vcpkg_cache,readwrite"
63+
VCPKG_BINARY_SOURCES: "clear;files,/Users/runner/work/ziti-sdk-swift/ziti-sdk-swift/deps/ziti-tunnel-sdk-c/${{ matrix.spec.toolchain }}/vcpkg_cache,readwrite"
5564
run: |
5665
(cd deps/ziti-tunnel-sdk-c && git fetch --tags)
5766
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTLSUV_TLSLIB=openssl -DEXCLUDE_PROGRAMS=ON -DVCPKG_INSTALL_OPTIONS="--overlay-ports=./deps/vcpkg-overlays/json-c" -DZITI_TUNNEL_BUILD_TESTS=OFF -DCMAKE_TOOLCHAIN_FILE="${TOOLCHAIN}" -S ./deps/ziti-tunnel-sdk-c -B ./deps/ziti-tunnel-sdk-c/${{ matrix.spec.name }}

0 commit comments

Comments
 (0)