fix(ci): fix ccache strategy and add runner cleanup

- Cache key: replace run_id (unique per build) with date-based key
  so entries are reused within the same day and rotate daily
- Skip cache save on exact hit (act_runner can't overwrite keys)
- build.sh: set CCACHE_DIR/CCACHE_BASEDIR inside rattler-build's
  isolated env so release builds actually use the cached directory
- build.sh: print ccache stats at end for diagnostics
- Add disk space cleanup step to build.yml (matching release.yml)
- Remove cross-build cache fallback in release.yml (different -O flags)
- Add runner cleanup daemon (.gitea/runner/) with systemd timer
  to purge stale cache entries, Docker data, and old workspaces
This commit is contained in:
forbes
2026-02-07 08:18:00 -06:00
parent 1e4deea130
commit 8ba7b73aa8
6 changed files with 285 additions and 7 deletions

View File

@@ -1,3 +1,15 @@
# Configure ccache to use a shared cache directory that persists across CI runs.
# The workflow caches /tmp/ccache-kindred-create between builds.
export CCACHE_DIR="${CCACHE_DIR:-/tmp/ccache-kindred-create}"
export CCACHE_BASEDIR="${SRC_DIR:-$(pwd)}"
export CCACHE_COMPRESS="${CCACHE_COMPRESS:-true}"
export CCACHE_COMPRESSLEVEL="${CCACHE_COMPRESSLEVEL:-6}"
export CCACHE_MAXSIZE="${CCACHE_MAXSIZE:-4G}"
export CCACHE_SLOPPINESS="${CCACHE_SLOPPINESS:-include_file_ctime,include_file_mtime,pch_defines,time_macros}"
mkdir -p "$CCACHE_DIR"
echo "ccache config: CCACHE_DIR=$CCACHE_DIR CCACHE_BASEDIR=$CCACHE_BASEDIR"
ccache -z || true
if [[ ${HOST} =~ .*linux.* ]]; then
CMAKE_PRESET=conda-linux-release
fi
@@ -46,3 +58,6 @@ cmake --install build
mv ${PREFIX}/bin/FreeCAD ${PREFIX}/bin/freecad || true
mv ${PREFIX}/bin/FreeCADCmd ${PREFIX}/bin/freecadcmd || true
echo "=== ccache statistics ==="
ccache -s || true