Report size of cache files on creation
Description
I ran into issues with caching build artifacts in a path that was outside the repository, in this case ~/.cache/bazel. While the output seemed to indicate that everything works just fine (cache was being created after building and extracted before builds started), actually the issue that caching is ONLY possible within the project directory is only documented in https://docs.gitlab.com/ce/ci/yaml/#cache, but does silently fail (or actually worse: succeed) within the logs.
Proposal
When creating the cache file, also report the file size of it in the logs at creation time.
Bonus: Write the line in red (with a link to documentation) if the file size is 0.
This does not solve the issue that caching should in my opinion be possible outside of the repository folder too, but it would at least give a hint to start re-reading the documentation and think about strategies for mitigating this limitation (e.g. by moving cache files to their intended location with a before_script and into the repo with an after_script, so they actually do get cached).
Links to related issues and merge requests / references
Various issues of people being confused that caching only works in the project directory or trying to debug if they set up caching correctly.