Repository navigation
CI add ccache for GitHub Actions - #31895
Conversation
|
Three comments for reviewers:
|
| uses: actions/cache@v4 | ||
| with: | ||
| path: ${{ github.workspace }}/ccache | ||
| key: ccache-${{ runner.os }}-${{ steps.get-compiler.outputs.compiler }} |
There was a problem hiding this comment.
do we want to make sure this is only within each PR, and not shared between PRs, to make sure there's no cache poisoning happening?
There was a problem hiding this comment.
@lesteve and I had talked about this. If I understood correctly then it would be preferable to allow sharing the ccache across several PRs, because ccache is smart enough to compare the contents of the source c and cpp files before reusing their build. I also think it would quickly clutter if we had a cache for each PR.
Or do you refer to security questions?
Another thought that came to my mind:
Does it make sense to have an action/repository setting/makefile command (not sure how it should look like) (here is an actions workflow that would do that) that deletes the ccache to clean out old min dependency builds that are not used anymore or when we need a fresh start. That could be regular or on demand.
There was a problem hiding this comment.
My understanding is that GHA cache already has some builtin protections, see doc.
|
can we test this by having another commit and see if cache works? |
|
Nice, it seems to work fine. There may be some tweaks that we can do which I will suggest soon:
|
adrinjalali
left a comment
There was a problem hiding this comment.
LGTM. I'll let @lesteve decide if improvements need to be done here or other PRs.
Co-authored-by: Loïc Estève <[email protected]>
Co-authored-by: Loïc Estève <[email protected]>
|
Here is the thinking behind the cache key:
|
|
Let's merge this one and adapt if we notice possible improvements to the cache key strategy. |
Co-authored-by: Loïc Estève <[email protected]>
Reference Issues/PRs
Follow up on #31832
What does this implement/fix? Explain your changes.
This PR adds a step to use a cache for ccache on the GitHub Actions job(s) in the
unit-tests.yml.Thanks for your support @lesteve and @adrinjalali! 🫶
Comments
From my experiments on another branch it seems that this speeds up the build of scikit-learn by 1 min (1 min instead of 2 mins) on ARM.
This won't work on windows.