Hi there,
I’m setting up CI for a project. It takes a couple of minutes to generate the project and a lot of that time is spent downloading content using FetchContent
. Since this content is unlikely to change regularly, it seems like it’s a good candidate to be cached.
CircleCI makes caching easy with its save_cache
and restore_cache
commands. These commands take a key to identify the cache, which would typically be some kind of hash of some kind of lock file (e.g. key: npm-dependencies-{{ checksum "package-lock.json" }}
).
My questions are as follows:
- Is it reasonable to cache the
_deps
folder at all? Will that cause build artefacts to be maintained between runs? Will CMake recognise that it doesn’t need to download the dependencies again? - Is there some kind of file that I can use as a key that can be used to ‘break the cache’ when a dependency changes?
Thanks!