Cache test-data zips in CI - #37
Merged
Merged
Conversation
Every matrix job downloads the CereLink test datasets (and, for integration, nPlayServer) fresh from GitHub's release-asset CDN, so one CDN blip anywhere in the 14 jobs fails the build -- as happened on PR #36 -- and each run pays ~40 MB of downloads it already did last time. Restore tests/.test_cache/*.zip with actions/cache; conftest.py already skips any download whose zip exists, and extraction is re-done cheaply. The key hashes conftest.py, which holds the release URL and asset names, so bumping the data version invalidates the cache. Deliberately no prefix restore-keys: the zip filenames are unversioned, so a stale dnss256.zip restored across a version bump would be silently used as current. The integration job gets its own key (it alone caches nPlayServer) with a same-hash fallback to the unit key. Pushes to dev now also run the workflow: PR caches are branch-scoped and can only read from their base branch, so without a run on dev merges, nothing would populate the cache PRs restore from. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the transient-500 flake seen on #36: every matrix job downloads the CereLink test datasets (and, for integration, nPlayServer) fresh from GitHub's release-asset CDN, so a single CDN blip anywhere in the 14 jobs fails the build, and each run re-pays ~40 MB of downloads. This restores
tests/.test_cache/*.zipwithactions/cache—conftest.pyalready skips any download whose zip exists, and extraction is cheap, so caching the zips alone is sufficient.Design notes, since cache keys are where this kind of thing goes quietly wrong:
tests/conftest.py, which holds the release URL and asset names — bumping the data version invalidates the cache automatically.restore-keys. The zip filenames are unversioned (dnss256.zip), so a stale zip restored across a version bump would be silently used as current data. A conftest edit therefore costs one re-download per OS, which is the safe direction.nPlayServer-*.zip; without a separate key the nPlay binary would never be cached. The fallback is safe because it carries the same conftest hash, so restored zips are current and only nPlayServer is fetched on top.devnow run the workflow. PR caches are branch-scoped and can only read caches from their base branch; previously nothing ran ondev, so no shared cache would ever exist and each PR would rebuild its own from scratch.actions/cacheskips its save step when the job fails, so a failed/interrupted download can't poison the cache (and Optimize SamplingDelayAlignment for MLX and right-size its fractional-delay FIR #36 additionally makes the conftest download atomic via a.partrename).First run after merge populates the
devcache; subsequent PR runs should show "Cache restored" and skip theDownloading …lines in the pytest output.🤖 Generated with Claude Code