Skip to content

Commit 1183dde

Browse files
committed
CI changes coming from add-combi
* Replace `lakefile.toml` by `lakefile.lean` * Acquire `scripts/build_docs.sh` * Drop `scripts/bump.sh`
1 parent ce53e9d commit 1183dde

File tree

8 files changed

+74
-188
lines changed

8 files changed

+74
-188
lines changed

.github/workflows/push_master.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,15 @@ jobs:
6161
sudo apt install graphviz -y
6262
~/.elan/bin/lake exe graph website/file_deps.pdf
6363
64-
- name: Cache dependencies docs
65-
uses: actions/cache@v3
64+
- name: Cache documentation
65+
uses: actions/cache@v4
6666
with:
67-
path: docbuild/.lake/build/doc
67+
path: website/docs
6868
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }}
69-
restore-keys: |
70-
MathlibDoc-
69+
restore-keys: MathlibDoc-
7170

7271
- name: Build documentation
73-
working-directory: docbuild
74-
run: |
75-
~/.elan/bin/lake exe cache get || true
76-
~/.elan/bin/lake build LeanCamCombi:docs
72+
run: scripts/build_docs.sh
7773

7874
# - name: Build blueprint and copy to `website/blueprint`
7975
# uses: xu-cheng/texlive-action@v2
@@ -91,8 +87,7 @@ jobs:
9187
# inv all
9288

9389
- name: Copy documentation to `website/docs`
94-
run: |
95-
mv docbuild/.lake/build/doc website/docs
90+
run: mv docs/build website/docs
9691

9792
- name: Bundle dependencies
9893
uses: ruby/setup-ruby@v1
@@ -116,4 +111,5 @@ jobs:
116111

117112
- name: Make sure the cache works
118113
run: |
114+
mkdir -p docbuild/.lake/build/doc
119115
mv website/docs docbuild/.lake/build/doc

docbuild/lake-manifest.json

Lines changed: 0 additions & 142 deletions
This file was deleted.

docbuild/lakefile.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

docbuild/lean-toolchain

Lines changed: 0 additions & 1 deletion
This file was deleted.

lakefile.lean

Lines changed: 0 additions & 15 deletions
This file was deleted.

lakefile.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name = "LeanCamCombi"
2+
defaultTargets = ["LeanCamCombi"]
3+
4+
[leanOptions]
5+
autoImplicit = false # Prevent typos to be interpreted as new free variables
6+
relaxedAutoImplicit = false
7+
pp.unicode.fun = true # Pretty-print lambdas as `fun a ↦ b`
8+
pp.proofs.withType = false # Elide the types of proofs in terms
9+
10+
[[require]]
11+
name = "mathlib"
12+
git = "https://github.com/leanprover-community/mathlib4.git"
13+
14+
[[lean_lib]]
15+
name = "LeanCamCombi"

scripts/build_docs.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Build HTML documentation for add-combi
2+
# The output will be located in docs/build
3+
4+
# Template lakefile.toml
5+
template() {
6+
cat <<EOF
7+
name = "docbuild"
8+
reservoir = false
9+
version = "0.1.0"
10+
packagesDir = "../.lake/packages"
11+
12+
[[require]]
13+
name = "LeanCamCombi"
14+
path = "../"
15+
16+
[[require]]
17+
scope = "leanprover"
18+
name = "doc-gen4"
19+
rev = "TOOLCHAIN"
20+
EOF
21+
}
22+
23+
# Create a temporary docbuild folder
24+
mkdir -p docbuild
25+
26+
# Equip docbuild with the template lakefile.toml
27+
template > docbuild/lakefile.toml
28+
29+
# Substitute the toolchain from lean-toolchain into docbuild/lakefile.toml
30+
sed -i s/TOOLCHAIN/`grep -oP 'v4\..*' lean-toolchain`/ docbuild/lakefile.toml
31+
32+
# Fetch the docs cache if it exists
33+
mkdir -p website/docs
34+
mkdir -p docbuild/.lake/build/doc
35+
mv website/docs docbuild/.lake/build/doc
36+
37+
# Initialise docbuild as a Lean project
38+
cd docbuild
39+
MATHLIB_NO_CACHE_ON_UPDATE=1 # Disable an error message due to a non-blocking bug. See Zulip
40+
~/.elan/bin/lake update LeanCamCombi
41+
~/.elan/bin/lake exe cache get
42+
43+
# Build the docs
44+
~/.elan/bin/lake build LeanCamCombi:docs
45+
46+
# Move them out of docbuild
47+
cd ../
48+
mkdir -p docs/build
49+
mv docbuild/.lake/build/doc docs/build
50+
51+
# Clean up after ourselves
52+
rm -rf docbuild

scripts/bump.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)