Compare commits

...
2 Commits
Author SHA1 Message Date
Tara Drwenski 5ed7e22afc Reduce ccache maxsize to 500 MB 2026-08-20 09:30:24 -07:00
Tara Drwenski 59a3ef07e9 CI: only save ccache on push, not on PRs
PR runs saved their own ccache entries keyed by run id, but measurements
show PR caches are essentially never reused before eviction, while the
repo sits over the 10 GB cache limit and LRU evicts the largest master
caches (the ones PRs actually warm-start from).

Split the combined actions/cache step into restore (all runs) + save
(pushes to master/next only). PRs still warm-start from the base
branch's cache via the restore-keys prefix but no longer write, bounding
total cache usage to the master+next working set.
2026-08-19 21:31:37 -07:00
+18 -8
View File
@@ -145,6 +145,7 @@ jobs:
# Enable ccache for all jobs except Windows (would need sccache).
env:
USE_CCACHE: ${{ matrix.os != 'windows-latest' }}
CCACHE_KEY: ccache-${{ matrix.os }}-${{ matrix.build-system }}-${{ matrix.target }}-${{ matrix.mpi }}-${{ matrix.hypre-target }}-${{ matrix.precision }}${{ matrix.enzyme && '-enzyme' || '' }}
steps:
# Fix 'No space left on device' errors for Ubuntu builds.
@@ -294,17 +295,18 @@ jobs:
echo "OMPI_CC=$LLVM_PREFIX/bin/clang" >> $GITHUB_ENV
echo "OMPI_CXX=$LLVM_PREFIX/bin/clang++" >> $GITHUB_ENV
# Restore the compiler cache (ccache). The key embeds the run id, so new
# runs save a fresh snapshot; the restore-keys prefix warm-starts from the
# most recent prior run (incl. the base branch for PRs).
- name: cache ccache
# Restore the compiler cache (ccache). All runs restore, but only pushes
# save (see "save ccache"). PRs warm-start from the base branch via the
# restore-keys prefix without saving their own, so they don't fill up the
# 10 GB repo cache limit.
- name: restore ccache
if: ${{ env.USE_CCACHE == 'true' }}
uses: actions/cache@v5
uses: actions/cache/restore@v5
with:
path: .ccache
key: ccache-${{ matrix.os }}-${{ matrix.build-system }}-${{ matrix.target }}-${{ matrix.mpi }}-${{ matrix.hypre-target }}-${{ matrix.precision }}${{ matrix.enzyme && '-enzyme' || '' }}-${{ github.run_id }}
key: ${{ env.CCACHE_KEY }}-${{ github.run_id }}
restore-keys: |
ccache-${{ matrix.os }}-${{ matrix.build-system }}-${{ matrix.target }}-${{ matrix.mpi }}-${{ matrix.hypre-target }}-${{ matrix.precision }}${{ matrix.enzyme && '-enzyme' || '' }}-
${{ env.CCACHE_KEY }}-
# Configure ccache and select how it is injected into the MFEM build:
# - make: set CXX="ccache g++"; for MPI, OMPI_CXX="ccache g++" so mpicxx
@@ -324,7 +326,7 @@ jobs:
fi
}
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=500M" >> $GITHUB_ENV
echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV
# Ignore header timestamps (restamped by each checkout) so direct mode hits.
echo "CCACHE_SLOPPINESS=include_file_mtime,include_file_ctime,time_macros" >> $GITHUB_ENV
@@ -363,6 +365,14 @@ jobs:
run: ccache -s
shell: bash
# Only pushes (master/next) save; see "restore ccache" above.
- name: save ccache
if: ${{ env.USE_CCACHE == 'true' && github.event_name == 'push' }}
uses: actions/cache/save@v5
with:
path: .ccache
key: ${{ env.CCACHE_KEY }}-${{ github.run_id }}
# Run checks (and only checks) on debug targets
- name: checks
if: matrix.build-system == 'make' && matrix.target == 'dbg'