@@ -141,12 +141,13 @@ jobs:
141141 persist-credentials : false
142142 fetch-depth : 0
143143 submodules : recursive
144- - name : Cache Docker Volumes
145- uses : actions/cache@v5
144+ - name : Restore Docker Volumes
145+ uses : actions/cache/restore @v5
146146 with :
147147 path : .docker
148- key : extra-${{ matrix.image }}-${{ hashFiles('cpp/**') }}
149- restore-keys : extra-${{ matrix.image }}-
148+ key : extra-${{ matrix.image }}-${{ github.run_id }}
149+ restore-keys : |
150+ extra-${{ matrix.image }}-
150151 - name : Setup Python
151152 uses : actions/setup-python@v6
152153 with :
@@ -169,6 +170,12 @@ jobs:
169170 done
170171 fi
171172 archery docker run ${{ matrix.run-options || '' }} ${{ matrix.image }}
173+ - name : Save Docker Volumes
174+ if : github.ref == 'refs/heads/main'
175+ uses : actions/cache/save@v5
176+ with :
177+ path : .docker
178+ key : extra-${{ matrix.image }}-${{ github.run_id }}
172179 - name : Docker Push
173180 if : >-
174181 success() &&
@@ -227,12 +234,13 @@ jobs:
227234 - name : Free up disk space
228235 run : |
229236 ci/scripts/util_free_space.sh
230- - name : Cache Docker Volumes
231- uses : actions/cache@v5
237+ - name : Restore Docker Volumes
238+ uses : actions/cache/restore @v5
232239 with :
233240 path : .docker
234- key : jni-${{ matrix.platform.runs-on }}-${{ hashFiles('cpp/**') }}
235- restore-keys : jni-${{ matrix.platform.runs-on }}-
241+ key : jni-${{ matrix.platform.runs-on }}-${{ github.run_id }}
242+ restore-keys : |
243+ jni-${{ matrix.platform.runs-on }}-
236244 - name : Setup Python
237245 uses : actions/setup-python@v6
238246 with :
@@ -248,6 +256,12 @@ jobs:
248256 run : |
249257 source ci/scripts/util_enable_core_dumps.sh
250258 archery docker run cpp-jni
259+ - name : Save Docker Volumes
260+ if : github.ref == 'refs/heads/main'
261+ uses : actions/cache/save@v5
262+ with :
263+ path : .docker
264+ key : jni-${{ matrix.platform.runs-on }}-${{ github.run_id }}
251265 - name : Docker Push
252266 if : >-
253267 success() &&
@@ -300,12 +314,13 @@ jobs:
300314 - name : Prepare ccache
301315 run : |
302316 echo "CCACHE_DIR=${PWD}/ccache" >> ${GITHUB_ENV}
303- - name : Cache ccache
304- uses : actions/cache@v5
317+ - name : Restore ccache
318+ uses : actions/cache/restore @v5
305319 with :
306320 path : ccache
307- key : jni-macos-${{ hashFiles('cpp/**') }}
308- restore-keys : jni-macos-
321+ key : jni-macos-${{ github.run_id }}
322+ restore-keys : |
323+ jni-macos-
309324 - name : CMake
310325 run : |
311326 cmake \
@@ -347,6 +362,12 @@ jobs:
347362 cmake --build cpp/examples/minimal_build.build
348363 cd cpp/examples/minimal_build
349364 ../minimal_build.build/arrow-example
365+ - name : Save ccache
366+ if : github.ref == 'refs/heads/main'
367+ uses : actions/cache/save@v5
368+ with :
369+ path : ccache
370+ key : jni-macos-${{ github.run_id }}
350371
351372 odbc-linux :
352373 needs : check-labels
@@ -372,12 +393,13 @@ jobs:
372393 persist-credentials : false
373394 fetch-depth : 0
374395 submodules : recursive
375- - name : Cache Docker Volumes
376- uses : actions/cache@v5
396+ - name : Restore Docker Volumes
397+ uses : actions/cache/restore @v5
377398 with :
378399 path : .docker
379- key : ubuntu-cpp-odbc-${{ hashFiles('cpp/**') }}
380- restore-keys : ubuntu-cpp-odbc-
400+ key : ubuntu-cpp-odbc-${{ github.run_id }}
401+ restore-keys : |
402+ ubuntu-cpp-odbc-
381403 - name : Setup Python on hosted runner
382404 uses : actions/setup-python@v6
383405 with :
@@ -393,6 +415,12 @@ jobs:
393415 sudo sysctl -w vm.mmap_rnd_bits=28
394416 source ci/scripts/util_enable_core_dumps.sh
395417 archery docker run ubuntu-cpp-odbc
418+ - name : Save Docker Volumes
419+ if : github.ref == 'refs/heads/main'
420+ uses : actions/cache/save@v5
421+ with :
422+ path : .docker
423+ key : ubuntu-cpp-odbc-${{ github.run_id }}
396424 - name : Docker Push
397425 if : >-
398426 success() &&
@@ -464,12 +492,13 @@ jobs:
464492 id : ccache-info
465493 run : |
466494 echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
467- - name : Cache ccache
468- uses : actions/cache@v5.0.2
495+ - name : Restore ccache
496+ uses : actions/cache/restore @v5.0.2
469497 with :
470498 path : ${{ steps.ccache-info.outputs.cache-dir }}
471- key : cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }}-${{ hashFiles('cpp/**') }}
472- restore-keys : cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }}-
499+ key : cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }}-${{ github.run_id }}
500+ restore-keys : |
501+ cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }}-
473502 - name : Build
474503 run : |
475504 # Homebrew uses /usr/local as prefix. So packages
@@ -530,6 +559,12 @@ jobs:
530559 sudo mkdir -p /Library/ODBC
531560 sudo chown -R $USER /Library/ODBC
532561 ci/scripts/cpp_test.sh $(pwd) $(pwd)/build
562+ - name : Save ccache
563+ if : github.ref == 'refs/heads/main'
564+ uses : actions/cache/save@v5
565+ with :
566+ path : ${{ steps.ccache-info.outputs.cache-dir }}
567+ key : cpp-odbc-ccache-macos-${{ matrix.macos-version }}-${{ matrix.build-type }}-${{ github.run_id }}
533568
534569 odbc-msvc :
535570 needs : check-labels
@@ -589,12 +624,13 @@ jobs:
589624 shell : bash
590625 run : |
591626 echo "cache-dir=$(ccache --get-config cache_dir)" >> $GITHUB_OUTPUT
592- - name : Cache ccache
593- uses : actions/cache@v5
627+ - name : Restore ccache
628+ uses : actions/cache/restore @v5
594629 with :
595630 path : ${{ steps.ccache-info.outputs.cache-dir }}
596- key : cpp-odbc-ccache-windows-x64-${{ hashFiles('cpp/**') }}
597- restore-keys : cpp-odbc-ccache-windows-x64-
631+ key : cpp-odbc-ccache-windows-x64-${{ github.run_id }}
632+ restore-keys : |
633+ cpp-odbc-ccache-windows-x64-
598634 - name : Checkout vcpkg
599635 uses : actions/checkout@v6
600636 with :
@@ -697,6 +733,12 @@ jobs:
697733
698734 Write-Error "ODBC DLL not found"
699735 exit 1
736+ - name : Save ccache
737+ if : github.ref == 'refs/heads/main'
738+ uses : actions/cache/save@v5
739+ with :
740+ path : ${{ steps.ccache-info.outputs.cache-dir }}
741+ key : cpp-odbc-ccache-windows-x64-${{ github.run_id }}
700742
701743 odbc-nightly :
702744 needs : odbc-msvc
0 commit comments