Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,26 @@ jobs:
with:
ocaml-compiler: "5.4.0"

# The bottleneck of this job is compiling the dependency tree plus wodoc and
# odoc from source; setup-ocaml only caches the base switch (the compiler),
# so they recompiled on every push. Cache the whole _opam switch keyed on the
# *.opam files (the dep set) and wodoc's HEAD commit; on a cache hit the
# install is skipped and only the project itself is (re)built by the doc step
# below. The key changes -- and the deps/wodoc rebuild once -- only when an
# *.opam file or wodoc move.
- name: Resolve wodoc HEAD commit
id: wodoc
run: echo "sha=$(git ls-remote https://github.com/ocsigen/wodoc.git HEAD | cut -f1)" >> "$GITHUB_OUTPUT"

- name: Cache the opam switch (deps + wodoc)
id: switch-cache
uses: actions/cache@v4
with:
path: _opam
key: opam-switch-${{ runner.os }}-ocaml5.4.0-${{ hashFiles('*.opam') }}-wodoc-${{ steps.wodoc.outputs.sha }}

- name: Install dependencies
if: steps.switch-cache.outputs.cache-hit != 'true'
run: |
opam install . --deps-only --with-doc # odoc is a with-doc dep
# wodoc: the odoc driver that themes the pages with the Ocsigen chrome.
Expand Down
Loading