Key the client Minecraft cache on the latest loader build - #81
Conversation
mc-runtime-test caches ~/.minecraft under a key without the loader version and skips the loader install on a hit, so CI kept running whichever NeoForge build was current when the cache was first created. Resolve the latest loader build from the same index HeadlessMC uses and put it in the cache key, so a new loader release invalidates the cache automatically. mc-server-test reinstalls the loader on every run and its cache holds nothing, so its caching is disabled instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CyN8GNANjyR3ZMmqjeRQRq
|
CI status on 469f0f2: Cache change verified. Client NeoForge jobs resolved the loader build, missed the new One red job, not caused by this PR: Generated by Claude Code |
Problem
mc-runtime-testcaches~/.minecraftunderLinux-<mc>-<loader>-hmc, a key without the loader build, and skips the loader install when the cached vanilla json exists.actions/cachenever re-saves on a hit, so CI keeps running whichever NeoForge build was current when that cache was first created, until someone deletes the caches by hand.Fix
.github/scripts/resolve-loader-version.shresolves the latest loader build for a Minecraft version from the same sources HeadlessMC uses (Prism meta index for NeoForge and Forge, Fabric meta for Fabric). It fails the job if it cannot resolve, since HeadlessMC would fail on the same index anyway and a silent fallback would reintroduce the bug.~/.minecraftitself, keyed onhmc-v1-<os>-<mc>-<loader>-<loader build>, and passescache-mc: falsetomc-runtime-test. A new loader release now invalidates the cache automatically. Norestore-keyson purpose: a partial hit would still skip the loader install. Bump thev1suffix to force a reset instead of deleting caches in the UI.mc-server-testgetscache-mc: falseas well. Its cache entries were 234 bytes and the action reinstalls the loader on every run regardless (seeInstalling NeoForge Server 1.21.1-21.1.250in cache-hit server jobs), so the server side was never stale and its cache and copy step were dead weight.Notes
Installing NeoForgeline.*-hmccache entries stop being touched and expire after 7 days.🤖 Generated with Claude Code
https://claude.ai/code/session_01CyN8GNANjyR3ZMmqjeRQRq
Generated by Claude Code