Add cache to github workflows (for dependencies) #1279
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trying to use the cache action. This should do the following:
${{ github.job }}-${{ hashFiles("./third_party/**") }}
, wheregithub.job
is the unique name of the job (e.g. 'iOS'), andhashFiles("./third_party/**")
computes one hash representing all the files inthird_party/
, which are CMakeLists and patches for our dependencies. Therefore, this should be a unique key for the job and for that set of dependencies../build/ios/third_party/install
has been saved for that job, which would be e.g. all the dependencies for the 'iOS' job. In that case, we want to disable the superbuild and use those dependencies, and we do it by adding e.g.-DSUPERBUILD=OFF -DCMAKE_PREFIX_PATH=$(pwd)/build/ios/third_pary/install
to the configure step later on.${{ deps_source }}
is defined, it will run without superbuild and with the cached deps. Otherwise it will run the superbuild and will cache the installed dependencies at the end, for the next run of that job (or a later job where the dependencies have not changed).First time I try that, let's hope it works 🤞.