ci(doc): cache the opam switch to skip recompiling the dependency tree#266
Merged
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.
Member
Author
|
So this caching PR is logically ready but can't be validated until the wasm build is fixed. The pattern itself (cache deps+wodoc, always rebuild the project via |
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 whole dependency tree (incl. wasm_of_ocaml) plus wodoc and odoc from source on every push (several minutes);setup-ocaml@v3only caches the base switch (the compiler).Fix
Cache the whole
_opamswitch withactions/cache, keyed on*.opam(the dependency set) and wodoc's resolved HEAD commit. The install is split:opam install .re-syncs the local pin and rebuilds it forodoc_driver --remapto document. Only the project recompiles on the hot path, not its dependencies.The cache rebuilds once when an
*.opamfile or wodoc's HEAD move.Same approach validated on ocsigen.github.io and ocsigenserver (each ~5 min → ~1 min).