ci(doc): cache the opam switch to skip recompiling the dependency tree#1118
Open
balat wants to merge 1 commit into
Open
ci(doc): cache the opam switch to skip recompiling the dependency tree#1118balat wants to merge 1 commit into
balat wants to merge 1 commit into
Conversation
The doc job recompiled the dependency tree plus wodoc and odoc from source on every push; setup-ocaml only caches the base switch. Cache the whole _opam switch keyed on the *.opam files and wodoc's HEAD commit, so a cache hit skips the install and only the project itself is rebuilt. The deps/wodoc rebuild once when an *.opam file or wodoc move, then re-cache.
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.
Problem
The
Documentationworkflow recompiles the dependency tree plus wodoc and odoc from source on every push (several minutes);setup-ocaml@v3only caches the base switch (the compiler), so none of that was cached.Fix
Cache the whole
_opamswitch withactions/cache, keyed on the*.opamfiles (the dependency set) and wodoc's resolved HEAD commit. On a cache hit the install step is skipped; the project itself is still rebuilt from the checkout bydune build @docin the doc step, so the docs stay current. The cache rebuilds once when an*.opamfile or wodoc's HEAD move.Same change validated on ocsigen.github.io (4 min → ~1 min) and ocsigenserver (5 min → ~1 min, cache hit confirmed). First run on this branch is a cache miss (populates the cache); the speed-up shows on the next run.