6060 runs-on : windows-2025
6161 cmake_build_type : Debug
6262 cmake_extra_args : -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
63- env :
64- SCCACHE_DIR : ${{ github.workspace }}/.sccache
65- SCCACHE_CACHE_SIZE : " 2G"
6663 steps :
6764 - name : Checkout iceberg-cpp
6865 uses : actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
7370 uses : ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
7471 with :
7572 arch : x64
76- # GitHub patches the Windows image roughly weekly via gradual rollouts, so
77- # back-to-back runs can hit different cl.exe builds. sccache keys on the compiler,
78- # so a shared key would miss after each bump; the version keeps caches separate.
79- # Non-Windows legs get an empty suffix, leaving their keys unchanged.
80- - name : Resolve MSVC version for sccache key
81- if : ${{ startsWith(matrix.runs-on, 'windows') }}
82- shell : pwsh
83- run : |
84- $PSNativeCommandUseErrorActionPreference = $false
85- $banner = (cl.exe 2>&1 | Out-String)
86- if ($banner -match 'Version ([\d.]+)') {
87- $suffix = "-$($Matches[1])"
88- } else {
89- # The key is only a cache hint, so degrade to a shared bucket rather than
90- # fail the build; the warning flags that the parse needs fixing.
91- $suffix = '-unknown'
92- Write-Host "::warning::could not parse cl.exe version for sccache key, using '$suffix'; banner was: $banner"
93- }
94- Add-Content -Path $env:GITHUB_ENV -Value "SCCACHE_KEY_SUFFIX=$suffix"
95- Write-Host "SCCACHE_KEY_SUFFIX=$suffix"
9673 - name : Install dependencies on Ubuntu
9774 if : ${{ startsWith(matrix.runs-on, 'ubuntu') }}
9875 shell : bash
@@ -114,15 +91,10 @@ jobs:
11491 shell : pwsh
11592 run : |
11693 vcpkg install zlib:x64-windows nlohmann-json:x64-windows nanoarrow:x64-windows roaring:x64-windows sqlite3:x64-windows
117- - name : Restore sccache cache
118- uses : actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
94+ - name : Set up sccache
95+ uses : ./.github/actions/setup-sccache
11996 with :
120- path : ${{ github.workspace }}/.sccache
121- key : sccache-sqlcatalog-${{ matrix.runs-on }}${{ env.SCCACHE_KEY_SUFFIX }}-${{ github.run_id }}
122- restore-keys : |
123- sccache-sqlcatalog-${{ matrix.runs-on }}${{ env.SCCACHE_KEY_SUFFIX }}-
124- - name : Setup sccache
125- uses : mozilla-actions/sccache-action@9e7fa8a12102821edf02ca5dbea1acd0f89a2696 # v0.0.10
97+ key-prefix : sccache-sqlcatalog-${{ matrix.runs-on }}
12698 - name : Configure Iceberg
12799 shell : bash
128100 run : |
@@ -140,15 +112,10 @@ jobs:
140112 - name : Build SQL catalog tests
141113 shell : bash
142114 run : cmake --build build --target sql_catalog_test
143- - name : Show sccache stats
144- shell : bash
145- run : sccache --show-stats
146- - name : Save sccache cache
147- if : github.ref == 'refs/heads/main'
148- uses : actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
115+ - name : Save sccache
116+ uses : ./.github/actions/save-sccache
149117 with :
150- path : ${{ github.workspace }}/.sccache
151- key : sccache-sqlcatalog-${{ matrix.runs-on }}${{ env.SCCACHE_KEY_SUFFIX }}-${{ github.run_id }}
118+ key-prefix : sccache-sqlcatalog-${{ matrix.runs-on }}
152119 - name : Run SQL catalog tests
153120 shell : bash
154121 run : ctest --test-dir build -R '^sql_catalog_test$' --output-on-failure -C ${{ matrix.cmake_build_type }}
0 commit comments