openmc
openmc copied to clipboard
Github Actions: Cache source-build executables and libraries to speed up testing
Whenever a commit is made to a PR, the openmc executable is built and ran for 11 different cases. This takes a lot of computational resources, as well as time. This is not ideal if the commit is something small and not directly related to the C++ source code, like docstrings, docpages, and the Python API
Github Actions supports caching to speed up these kinds of processes.
I propose that we modify the ci.yml workflow to do the following:
- create independent caches for each of the 11 different cases
- If a commit contains no changes to
src, restore from the cache for that case; otherwise, build the source code and store the new sources in the cache.
This workflow does this kind of caching, albeit in the simplest case (serial HDF5, no extra libraries).
@yardasol That's a really great idea if it can be done effectively. It's a little more complicated than just checking src. We'd also want to check: include/, CMakeLists.txt, cmake/, vendor/, and anything else that might indirectly affect builds (probably tools/ci/).
Good point @paulromano! And I think this can be done effectively if we are tactical about what specifically we choose to cache (only OpenMC vs OpenMC and all the extra dependencies for that specific case).