File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 uses : ocaml/setup-ocaml@v3
3232 with :
3333 ocaml-compiler : " 5.4.0"
34+ # The bottleneck of this job is compiling the dependency tree plus wodoc and
35+ # odoc from source; setup-ocaml only caches the base switch (the compiler),
36+ # so they recompiled on every push. Cache the whole _opam switch keyed on the
37+ # *.opam files (the dep set) and wodoc's HEAD commit; on a cache hit the
38+ # install is skipped and only the project itself is (re)built by the doc step
39+ # below. The key changes -- and the deps/wodoc rebuild once -- only when an
40+ # *.opam file or wodoc move.
41+ - name : Resolve wodoc HEAD commit
42+ id : wodoc
43+ run : echo "sha=$(git ls-remote https://github.com/ocsigen/wodoc.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"
44+
45+ - name : Cache the opam switch (deps + wodoc)
46+ id : switch-cache
47+ uses : actions/cache@v4
48+ with :
49+ path : _opam
50+ key : opam-switch-${{ runner.os }}-ocaml5.4.0-${{ hashFiles('*.opam') }}-wodoc-${{ steps.wodoc.outputs.sha }}
51+
3452 - name : Install dependencies
53+ if : steps.switch-cache.outputs.cache-hit != 'true'
3554 run : |
3655 opam install . --deps-only --with-doc
3756 opam pin add -n wodoc https://github.com/ocsigen/wodoc.git
You can’t perform that action at this time.
0 commit comments