mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
ci: log per-job ccache stats
This commit is contained in:
@@ -119,6 +119,11 @@ variables:
|
|||||||
# configure cmake related flags
|
# configure cmake related flags
|
||||||
source tools/ci/configure_ci_environment.sh
|
source tools/ci/configure_ci_environment.sh
|
||||||
|
|
||||||
|
if [[ "$CI_CCACHE_STATS" == 1 ]] && command -v ccache >/dev/null 2>&1 && [[ -n "$CCACHE_STATSLOG" ]]; then
|
||||||
|
mkdir -p "$(dirname "$CCACHE_STATSLOG")"
|
||||||
|
rm -f "$CCACHE_STATSLOG"
|
||||||
|
fi
|
||||||
|
|
||||||
# add extra python packages
|
# add extra python packages
|
||||||
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
|
||||||
|
|
||||||
@@ -240,7 +245,17 @@ variables:
|
|||||||
.show_ccache_statistics: &show_ccache_statistics |
|
.show_ccache_statistics: &show_ccache_statistics |
|
||||||
# Show ccache statistics if enabled globally
|
# Show ccache statistics if enabled globally
|
||||||
section_start "ccache_show_stats" "Show ccache statistics"
|
section_start "ccache_show_stats" "Show ccache statistics"
|
||||||
test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats -vv || true
|
if [[ "$CI_CCACHE_STATS" == 1 ]] && command -v ccache >/dev/null 2>&1; then
|
||||||
|
if ccache --help 2>/dev/null | grep -q -- '--show-log-stats'; then
|
||||||
|
if [[ -n "$CCACHE_STATSLOG" && -f "$CCACHE_STATSLOG" ]]; then
|
||||||
|
ccache --show-log-stats -vv
|
||||||
|
else
|
||||||
|
echo "INFO: No per-job ccache statistics were recorded"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
ccache --show-stats -vv
|
||||||
|
fi
|
||||||
|
fi || true
|
||||||
section_end "ccache_show_stats"
|
section_end "ccache_show_stats"
|
||||||
|
|
||||||
.upload_failed_job_log_artifacts: &upload_failed_job_log_artifacts |
|
.upload_failed_job_log_artifacts: &upload_failed_job_log_artifacts |
|
||||||
@@ -255,6 +270,7 @@ variables:
|
|||||||
.after_script:build:
|
.after_script:build:
|
||||||
after_script:
|
after_script:
|
||||||
- source tools/ci/utils.sh
|
- source tools/ci/utils.sh
|
||||||
|
- source tools/ci/configure_ci_environment.sh
|
||||||
- *show_ccache_statistics
|
- *show_ccache_statistics
|
||||||
- *upload_failed_job_log_artifacts
|
- *upload_failed_job_log_artifacts
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,13 @@ fi
|
|||||||
# https://ccache.dev/manual/latest.html#_configuring_ccache
|
# https://ccache.dev/manual/latest.html#_configuring_ccache
|
||||||
# Set ccache base directory to the project checkout path, to cancel out differences between runners
|
# Set ccache base directory to the project checkout path, to cancel out differences between runners
|
||||||
export CCACHE_BASEDIR="${IDF_PATH}"
|
export CCACHE_BASEDIR="${IDF_PATH}"
|
||||||
|
export CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK:-content}"
|
||||||
|
|
||||||
# host mapping volume to share ccache fbetween runner concurrent jobs
|
# host mapping volume to share ccache fbetween runner concurrent jobs
|
||||||
export CCACHE_SLOPPINESS="time_macros"
|
export CCACHE_SLOPPINESS="time_macros,file_macro,include_file_mtime,include_file_ctime"
|
||||||
|
|
||||||
|
# Keep per-job statistics in the checkout directory while sharing the cache itself.
|
||||||
|
export CCACHE_STATSLOG="${CCACHE_STATSLOG:-${IDF_PATH}/.ccache-stats.log}"
|
||||||
|
|
||||||
# CCACHE_RECACHE Used when invalidating the current cache.
|
# CCACHE_RECACHE Used when invalidating the current cache.
|
||||||
# could be enabled by MR label "ccache:recache"
|
# could be enabled by MR label "ccache:recache"
|
||||||
|
|||||||
Reference in New Issue
Block a user