-
Notifications
You must be signed in to change notification settings - Fork 139
Using cache when building documentation #953
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
Conversation
I'm not applying this to the nightly doc build (no cache there) |
Codecov Report
@@ Coverage Diff @@
## main #953 +/- ##
=======================================
Coverage 73.02% 73.02%
=======================================
Files 39 39
Lines 5712 5712
=======================================
Hits 4171 4171
Misses 1541 1541 |
Made another commit to remove project coverage requirement partially to trigger the CI again. I’ll determine example build time improvement after latest commit. |
Docs being fully rebuilt each time:
Seems that we're getting a cache hit with a bad cache key:
Recommend not using OS, and instead using the version of the package. This way the key is cleared when a new version is a released (this way, all examples are rebuild but only on release). Do this with: https://stackoverflow.com/a/65616499/3369879 Using the output from |
also avoid conflicts when using several runs. Separating Installing docs requirements.
uses: actions/cache@v2 | ||
with: | ||
path: doc/build | ||
key: doc-build-${{ steps.version.outputs.PYMAPDL_VERSION }}-${{ github.sha }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this mean that this will be different each time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes... but...
since the "restore-key" is used as a glob pattern, it will match the last version of the cache. I need to "create" a different sha every time, otherwise you cannot store the cache if there is another workflow run going on.
I hope this makes sense.
I think this is ready:
Almost 50% reduction in building time. Of course, this is a one test metric, so it is not super reliable, but overall, I will expect to a decent reduction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work implementing this! 50% reduction is a big deal, and now we can keep adding examples without bloating our CI/CD.
Using cache to avoid running all the examples every time we do push/PR
Close #951