Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cache to github workflows (for dependencies) #1279

Merged
merged 9 commits into from
Dec 8, 2020
Merged

Conversation

JonasVautherin
Copy link
Collaborator

Trying to use the cache action. This should do the following:

  1. Try to find a cached directory matching key ${{ github.job }}-${{ hashFiles("./third_party/**") }}, where github.job is the unique name of the job (e.g. 'iOS'), and hashFiles("./third_party/**") computes one hash representing all the files in third_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.
  2. If there is a cache hit, it means that ./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.
  3. When the configure step runs, if ${{ 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 🤞.

@JonasVautherin JonasVautherin force-pushed the ci-cache branch 13 times, most recently from 51a8fc8 to c13da21 Compare December 4, 2020 13:59
@JonasVautherin
Copy link
Collaborator Author

Except for the alpine build (for which I opened an issue here), I think that it is working pretty well. The iOS builds take ~7min instead of almost an hour before, and others like the dockcross builds are ~10min faster 🚀.

@JonasVautherin JonasVautherin force-pushed the ci-cache branch 2 times, most recently from 0a0c3e3 to d308690 Compare December 8, 2020 21:43
Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it!

@julianoes julianoes merged commit 8d4ede5 into develop Dec 8, 2020
@julianoes julianoes deleted the ci-cache branch December 8, 2020 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants