Speed up build workflow with ccache #135
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.
Use ccache to speed up C and C++ compilation triggered by build.yml.
This only affect MacOs and Linux runners.
For MacOs, installation, configuration and github caching is done
through the hendrikmuhs/ccache action.
Cmake is set to use ccache through the env variable CMAKE_*_COMPILER_LAUNCHER.
For Linux, installation is done in build-skdecide_dev, config and link with
Cmake in build-many-linux-wheels.sh.
The cache directory is fetched from the docker image to the .ccache directory
to be cached by the default github cache action and reused in later runs
For Linux, the setup is gated by the existence of .ccache directory that is either
restored from github cache or created in Build_x86_64. This ensure that release.yml
doesn't use ccache while still sharing the dockerfiles and scripts used by build.yml.
For both runners, ccache is configured to use compression (by default for the version used by macOs)
and limits cache size to 80M.
Note that for the cache to be saved by github, a new one is created every run.