-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: generate doc-building repository in CI (#334)
* CI: regenerate doc-building repository in CI * Don't have `docbuild` lying around always. Currently, the toolchain it gets updated to is independent of the toolchain FLT is on, causing issue every first few days of the month. Now, the toolchain with which the docs are built will always be the one from FLT. No one anymore can accidentally introduce a toolchain mismatch error in the repo by modifying/forgetting to modify the pinned toolchain in `docbuild/lakefile.toml`. * Add `scripts/build_docs.sh` to automate building the docs. This script creates a temporary `docbuild` repo, generates the docs, then deletes the temporary repo again. * Remove `scripts/bump.sh`. Now that `docbuild` doesn't exist outside of CI/building the docs locally with `build_docs.sh`, instructions to update the repo are simply "Run `lake update`". * Remove working directory * typo Co-authored-by: Pietro Monticone <[email protected]> * MATHLIB_NO_CACHE_ON_UPDATE --------- Co-authored-by: Pietro Monticone <[email protected]>
- Loading branch information
1 parent
85df81a
commit 1bd7105
Showing
5 changed files
with
50 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Build HTML documentation for FLT | ||
# The output will be located in docs/docs | ||
|
||
# Template lakefile.toml | ||
template() { | ||
cat <<EOF | ||
name = "docbuild" | ||
reservoir = false | ||
version = "0.1.0" | ||
packagesDir = "../.lake/packages" | ||
[[require]] | ||
name = "FLT" | ||
path = "../" | ||
[[require]] | ||
scope = "leanprover" | ||
name = "doc-gen4" | ||
rev = "TOOLCHAIN" | ||
EOF | ||
} | ||
|
||
# Create a temporary docbuild folder | ||
mkdir -p docbuild | ||
|
||
# Equip docbuild with the template lakefile.toml | ||
template > docbuild/lakefile.toml | ||
|
||
# Substitute the toolchain from lean-toolchain into docbuild/lakefile.toml | ||
sed -i s/TOOLCHAIN/`grep -oP 'v4\..*' lean-toolchain`/ docbuild/lakefile.toml | ||
|
||
# Initialise docbuild as a Lean project | ||
cd docbuild | ||
MATHLIB_NO_CACHE_ON_UPDATE=1 # Disable an error message due to a non-blocking bug. See Zulip | ||
~/.elan/bin/lake update FLT | ||
~/.elan/bin/lake exe cache get | ||
|
||
# Build the docs | ||
~/.elan/bin/lake build FLT:docs | ||
|
||
# Move them out of docbuild | ||
cd ../ | ||
mv docbuild/.lake/build/doc docs/docs | ||
|
||
# Clean up after ourselves | ||
rm -rf docbuild |
This file was deleted.
Oops, something went wrong.