openmc icon indicating copy to clipboard operation
openmc copied to clipboard

Github Actions: Cache source-build executables and libraries to speed up testing

Open yardasol opened this issue 3 years ago • 2 comments

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 avatar Jul 28 '22 21:07 yardasol

@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/).

paulromano avatar Aug 01 '22 16:08 paulromano

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).

yardasol avatar Aug 02 '22 18:08 yardasol