ci: Autodetect if cacche is available to print the stats

Always print the stats if ccache executable exists, this way
we can get rid of one extra env var.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5543>
This commit is contained in:
Jordan Petridis 2023-10-25 10:54:02 +03:00 committed by GStreamer Marge Bot
parent 5685db7358
commit 6c7956ab93
2 changed files with 11 additions and 5 deletions

View file

@ -252,7 +252,6 @@ commitlint:
.build_ccache_vars:
variables:
HAVE_CCACHE: 'true'
CCACHE_COMPILERCHECK: 'content'
CCACHE_COMPRESS: 'true'
CCACHE_BASEDIR: '/cache/gstreamer/gstreamer'
@ -518,7 +517,6 @@ build macos:
- '.macos image'
variables:
# gst-libav/ffmpeg throws Wundef errors
HAVE_CCACHE: 'false'
GST_WERROR: "false"
MESON_ARGS: "${DEFAULT_MESON_ARGS}"
SUBPROJECTS_CACHE_DIR: "/Users/gst-ci/subprojects"

View file

@ -10,8 +10,6 @@ set -eux
# GST_WERROR: make warning fatal or not
# must be a string of a boolean, "true" or "false". Not yaml bool.
# SUBPROJECTS_CACHE_DIR: The location in the image of the subprojects cache
# HAVE_CCACHE: whether we have ccache available
# must be a string of a boolean, "true" or "false". Not yaml bool.
export RUSTUP_HOME="/usr/local/rustup"
export CARGO_HOME="/usr/local/cargo"
@ -29,8 +27,18 @@ fi
date -R
meson setup build/ --native-file ./ci/meson/gst-ci-cflags.ini ${ARGS}
date -R
if command -v ccache
then
ccache --show-stats
fi
date -R
meson compile -C build/
date -R
test "$HAVE_CCACHE" = "true" && ccache --show-stats
if command -v ccache
then
ccache --show-stats
fi