Skip to content

Commit 24af46e

Browse files
authored
chore: reducing GHA cache size by building and caching only release versions (#1608)
1 parent 56e963f commit 24af46e

13 files changed

Lines changed: 56 additions & 7 deletions

.github/workflows/windows-cmake.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
id: cache-restore
9696
with:
9797
path: ${{ runner.temp }}/vcpkg-cache
98-
key: vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json', 'ci/etc/vcpkg-version.txt') }}
98+
key: vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json', 'ci/etc/vcpkg-version.txt', 'vcpkg-configuration.json', 'ci/etc/triplets/**') }}
9999
restore-keys: |
100100
vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-
101101
# go/github-actions#gha-bestpractices explains why we use a SHA instead of
@@ -114,7 +114,7 @@ jobs:
114114
CLOUDSDK_PYTHON: ${{ steps.py311.outputs.python-path }}
115115
BRANCH_NAME: ${{ github.ref_name }}
116116
run: |
117-
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
117+
export VCPKG_ROOT=$(cygpath -w "${TEMP}/.build/vcpkg")
118118
export CMAKE_OUT="c:/b"
119119
120120
export MSVC_VERSION="${{ matrix.msvc }}"
@@ -132,7 +132,7 @@ jobs:
132132
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
133133
with:
134134
path: ${{ runner.temp }}/vcpkg-cache
135-
key: vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json', 'ci/etc/vcpkg-version.txt') }}
135+
key: vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json', 'ci/etc/vcpkg-version.txt', 'vcpkg-configuration.json', 'ci/etc/triplets/**') }}
136136

137137
- name: Build and Upload Windows Installer
138138
if: env.BUILD_SHARD == 'BqDriver'
@@ -170,7 +170,7 @@ jobs:
170170
CLOUDSDK_PYTHON: ${{ steps.py311.outputs.python-path }}
171171
BRANCH_NAME: ${{ github.ref_name }}
172172
run: |
173-
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
173+
export VCPKG_ROOT=$(cygpath -w "${TEMP}/.build/vcpkg")
174174
# Put the CMake output in a directory with more space and keep it short
175175
# to avoid running into the MSVC limits.
176176
export CMAKE_OUT='c:\b'

.github/workflows/windows-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
8989
with:
9090
path: ${{ runner.temp }}/vcpkg-cache
91-
key: vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json', 'ci/etc/vcpkg-version.txt') }}
91+
key: vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-${{ hashFiles('vcpkg.json', 'ci/etc/vcpkg-version.txt', 'vcpkg-configuration.json', 'ci/etc/triplets/**') }}
9292
restore-keys: |
9393
vcpkg-cache-${{ matrix.msvc }}-${{ matrix.arch }}-
9494
# go/github-actions#gha-bestpractices explains why we use a SHA instead of
@@ -115,7 +115,7 @@ jobs:
115115
DRIVER_VERSION: ${{ steps.version.outputs.version }}
116116
BRANCH_NAME: ${{ github.ref_name }}
117117
run: |
118-
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
118+
export VCPKG_ROOT=$(cygpath -w "${TEMP}/.build/vcpkg")
119119
export CMAKE_OUT="c:/b"
120120
121121
@@ -261,7 +261,7 @@ jobs:
261261
CLOUDSDK_PYTHON: ${{ steps.py311.outputs.python-path }}
262262
BRANCH_NAME: ${{ github.ref_name }}
263263
run: |
264-
export VCPKG_ROOT="${TEMP}/.build/vcpkg"
264+
export VCPKG_ROOT=$(cygpath -w "${TEMP}/.build/vcpkg")
265265
export MSVC_VERSION="${{ matrix.msvc }}"
266266
export BRANCH_IDENTIFIER=$(echo "$BRANCH_NAME" | tr '[:punct:]' '_')
267267
export CPP_BIGQUERY_ODBC_TEST_TABLE_PREFIX="windows_${BRANCH_IDENTIFIER}_${MSVC_VERSION//[-:;.,?\/]/_}_${DRIVER_ARCH}_$BUILD_SHARD"

ci/etc/triplets/arm64-osx.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set(VCPKG_TARGET_ARCHITECTURE arm64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
5+
set(VCPKG_OSX_ARCHITECTURES arm64)
6+
set(VCPKG_BUILD_TYPE release)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_TARGET_ARCHITECTURE arm64)
2+
set(VCPKG_CRT_LINKAGE static)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
set(VCPKG_BUILD_TYPE release)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_TARGET_ARCHITECTURE arm64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE dynamic)
4+
set(VCPKG_BUILD_TYPE release)

ci/etc/triplets/x64-osx.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
set(VCPKG_CMAKE_SYSTEM_NAME Darwin)
5+
set(VCPKG_OSX_ARCHITECTURES x86_64)
6+
set(VCPKG_BUILD_TYPE release)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
set(VCPKG_BUILD_TYPE release)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x64)
2+
set(VCPKG_CRT_LINKAGE static)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
set(VCPKG_BUILD_TYPE release)

ci/etc/triplets/x64-windows.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE dynamic)
4+
set(VCPKG_BUILD_TYPE release)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(VCPKG_TARGET_ARCHITECTURE x86)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_LIBRARY_LINKAGE static)
4+
set(VCPKG_BUILD_TYPE release)

0 commit comments

Comments
 (0)