TheAfroOfDoom / omegaflowey-minecraft-remastered

MIT License
3 stars 1 forks source link

👷 support partial cache restore for AJ exports in CI #184

Closed TheAfroOfDoom closed 3 weeks ago

TheAfroOfDoom commented 3 weeks ago

Summary

closes #160

The cache/restore action supports partial key matches, which (when an exact match isn't available) will restore a cache if the current key matches some specified prefix of another cache key.

We change our AJ blueprint files often, but rarely all at once except for Blockbench / AJ version upgrades. We also already have last_exported_hashes.json to make the ajexport.js script effectively performing partial cache restores on local machines.

This PR hooks up last_exported_hashes.json to our custom CI action so we can:

Note: we do NOT perform a partial restore if the BB/AJ version has changed, because last_exported_hashes.json only saves the model file hashes. So if either of BB/AJ has a version change, we assume no other cache is valid for us.


Preview

The test runs of this resulted in significant speed increases (see commits):

first run, no cache restore changing one small model changing a different small model changing a large model
1m44s 48s 42s 1m11s