support stale-cache restoring in AJ export CI action
Opened this issue · 0 comments
a follow-up to #81
the most common case of the AJ export cache becoming outdated will be when we update a relatively small amount of .ajblueprint
files.
currently, the AJ exporter logic in CI (under the datapack/test
job) will have to re-export every .ajblueprint
, even if only a few actually changed
we can speed up this process significantly by utilizing our last_exported_hashes.json
logic and the cache action's restore-keys
field:
- https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
- https://github.com/actions/cache/blob/main/restore/README.md#inputs
together, these allow us to perform a partial restore using an old cache (e.g. one where most of the AJ export files are still up-to-date).
the auto-exporter already reads last_exported_hashes.json
and automatically determines what .ajblueprint
s it actually needs to re-export. it skips over up-to-date export files. this would decrease the auto-exporter time down from a few minutes to a few seconds (depending on how many .ajblueprint
files were updated in a commit)
TODO of this ticket is to:
- add
last_exported_hashes.json
to the AJ export cache paths in oursetup-animated-java-exports
CI action - add a
restore-keys
field (without thehashFiles...
suffix) to theactions/cache/restore
parameters so it can partial restore old AJ export caches of the same Blockbench/Animated Java version - test the AJ export process speeds up when it needs to re-export only a few changed
.ajblueprint
files