Skip to content

Commit 0aff5e9

Browse files
abnobdossAbanoub Doss
andauthored
ci: cache vcpkg packages on Windows builds (#766)
## What Cache the installed vcpkg packages on the Windows builds in `test` and `sql_catalog_test`, and skip the install step when the cache is present. ## Why Every Windows run reinstalls the same packages (zlib, nlohmann-json, nanoarrow, roaring, plus cpr / sqlite3) from scratch, costing a couple of minutes each time. Caching them removes that on every run after the first. This matches what `aws_test` already does. ## Validation A warm run reused the cached packages and skipped the install. The cache only rebuilds when the package list changes. Co-authored-by: Abanoub Doss <abanoub.doss@gmail.com>
1 parent a38e0cd commit 0aff5e9

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

.github/workflows/sql_catalog_test.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,15 @@ jobs:
8080
run: |
8181
echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV
8282
echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV
83-
- name: Install dependencies on Windows
83+
- name: Cache vcpkg packages
8484
if: ${{ startsWith(matrix.runs-on, 'windows') }}
85+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
86+
id: vcpkg-cache
87+
with:
88+
path: C:/vcpkg/installed
89+
key: vcpkg-x64-windows-sql-catalog-${{ hashFiles('.github/workflows/sql_catalog_test.yml') }}
90+
- name: Install dependencies on Windows
91+
if: ${{ startsWith(matrix.runs-on, 'windows') && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
8592
shell: pwsh
8693
run: |
8794
vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows sqlite3:x64-windows

.github/workflows/test.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,14 @@ jobs:
9999
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
100100
with:
101101
arch: x64
102+
- name: Cache vcpkg packages
103+
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
104+
id: vcpkg-cache
105+
with:
106+
path: C:/vcpkg/installed
107+
key: vcpkg-x64-windows-test-${{ hashFiles('.github/workflows/test.yml') }}
102108
- name: Install dependencies
109+
if: ${{ steps.vcpkg-cache.outputs.cache-hit != 'true' }}
103110
shell: pwsh
104111
run: |
105112
vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows cpr:x64-windows

0 commit comments

Comments
 (0)