cli.commands.cache

cli.commands.cache#

showyourwork.cli.commands.cache.cache_restore()#

Runs after restoring the cache on GitHub Actions using @actions/cache.

This function resets the timestamps of all files in the repository and then touches all files modified since the last time the action was run. This is meant to mimic the behavior one would get if running showyourwork locally, where only files whose upstream dependencies have fresher timestamps get rebuilt.

Note that we only cache files in src/tex/figures and src/tex/output (see the showyourwork-action).

showyourwork.cli.commands.cache.cache_update()#

Runs before updating the cache using @actions/cache.

This function writes the current commit SHA to a file in the repository so we can track which files changed the next time we run the action.

showyourwork.cli.commands.cache.get_modified_files(commit='HEAD^')#

Return all files that changed since commit.

Parameters:

commit (str) – The commit to compare against.

Returns:

A list of Path objects for all files that changed since commit.

Return type:

list