ci: show more verbose ccache stats

...and inline function used only once
This commit is contained in:
will
2026-02-02 09:30:27 +00:00
parent 580e9eefe3
commit 7528d18796

View File

@@ -116,7 +116,6 @@ if [ -z "$NO_WERROR" ]; then
fi
ccache --zero-stats
PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats"
# Folder where the build is done.
BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build-$HOST}
@@ -147,7 +146,7 @@ cmake --build "${BASE_BUILD_DIR}" "$MAKEJOBS" --target $GOAL || (
false
)
bash -c "${PRINT_CCACHE_STATISTICS}"
ccache --version | head -n 1 && ccache --show-stats --verbose
hit_rate=$(ccache --show-stats | grep "Hits:" | head -1 | sed 's/.*(\(.*\)%).*/\1/')
if [ "${hit_rate%.*}" -lt 75 ]; then
echo "::notice title=low ccache hitrate::Ccache hit-rate in $CONTAINER_NAME was $hit_rate%"