1+ name : Build Lean project
2+
13on :
24 push :
35 branches :
@@ -29,94 +31,85 @@ jobs:
2931 name : Build project
3032 steps :
3133 - name : Checkout project
32- uses : actions/checkout@v2
33- with :
34- fetch-depth : 0
34+ uses : actions/checkout@v4
3535
36- - name : Print files to upstream
37- run : |
38- grep -r --files-without-match 'import PersistentDecomp' PersistentDecomp | sort > 1.txt
39- grep -r --files-with-match 'sorry' PersistentDecomp | sort > 2.txt
40- mkdir -p docs/_includes
41- comm -23 1.txt 2.txt | sed -e 's/^\(.*\)$/- [`\1`](https:\/\/github.com\/Paul-Lez\/PersistentDecomp\/blob\/master\/\1)/' > docs/_includes/files_to_upstream.md
42- rm 1.txt 2.txt
36+ - name : Copy README.md to website/index.md
37+ run : cp README.md website/index.md
4338
44- - name : Count sorries
45- run : python scripts/count_sorry.py
39+ - name : Check PersistentDecomp.Mathlib only imports from Mathlib or PersistentDecomp.Mathlib
40+ run : python3 scripts/check_mathlib_imports.py
41+
42+ - name : Upstreaming dashboard
43+ run : |
44+ mkdir -p website/_includes
45+ python3 scripts/upstreaming_dashboard.py
4646
4747 - name : Install elan
48- run : curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:4.5 .0
48+ run : curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:4.15 .0
4949
5050 - name : Get cache
5151 run : ~/.elan/bin/lake exe cache get || true
5252
5353 - name : Build project
5454 run : ~/.elan/bin/lake build PersistentDecomp
5555
56- - name : Cache mathlib docs
57- uses : actions/cache@v3
56+ - name : File dependencies
57+ run : |
58+ sudo apt-get update
59+ sudo apt install graphviz -y
60+ ~/.elan/bin/lake exe graph website/file_deps.pdf
61+
62+ - name : Cache documentation
63+ uses : actions/cache@v4
5864 with :
59- path : |
60- .lake/build/doc/Init
61- .lake/build/doc/Lake
62- .lake/build/doc/Lean
63- .lake/build/doc/Std
64- .lake/build/doc/Mathlib
65- .lake/build/doc/declarations
65+ path : website/docs
6666 key : MathlibDoc-${{ hashFiles('lake-manifest.json') }}
67- restore-keys : |
68- MathlibDoc-
67+ restore-keys : MathlibDoc-
6968
7069 - name : Build documentation
71- run : ~/.elan/bin/lake -R -Kenv=dev build PersistentDecomp:docs
70+ run : scripts/build_docs.sh
7271
73- # - name: Build blueprint and copy to `docs /blueprint`
72+ # - name: Build blueprint and copy to `website /blueprint`
7473 # uses: xu-cheng/texlive-action@v2
7574 # with:
76- # docker_image: ghcr.io/xu-cheng/texlive- full:20231201
75+ # scheme: full
7776 # run: |
7877 # apk update
7978 # apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev
8079 # git config --global --add safe.directory $GITHUB_WORKSPACE
8180 # git config --global --add safe.directory `pwd`
82- # python3 -m venv env
83- # source env/bin/activate
84- # pip install --upgrade pip requests wheel
85- # pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
86- # pip install leanblueprint
87- # leanblueprint pdf
88- # cp blueprint/print/print.pdf docs/blueprint.pdf
89- # leanblueprint web
90- # cp -r blueprint/web docs/blueprint
91-
92- - name : Move documentation to `docs/docs`
81+ # python3 -m pip install --upgrade pip requests wheel
82+ # python3 -m pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
83+ # pip install -r blueprint/requirements.txt
84+ # python3 -m pip install invoke
85+ # inv all
86+
87+ - name : Copy documentation to `website/docs`
9388 run : |
94- mv .lake/build/doc docs/docs
89+ mkdir -p website/docs
90+ mv docs/build website/docs
9591
9692 - name : Bundle dependencies
9793 uses : ruby/setup-ruby@v1
9894 with :
99- working-directory : docs
100- ruby-version : " 3.0" # Specify Ruby version
101- bundler-cache : true # Enable caching for bundler
95+ working-directory : website
96+ ruby-version : " 3.0" # Not needed with a .ruby- version file
97+ bundler-cache : true # runs 'bundle install' and caches installed gems automatically
10298
103- - name : Build website using Jekyll
104- working-directory : docs
105- run : JEKYLL_ENV=production bundle exec jekyll build # Note this will also copy the blueprint and API doc into docs/_site
99+ - name : Bundle website
100+ working-directory : website
101+ run : JEKYLL_ENV=production bundle exec jekyll build
106102
107103 - name : Upload docs & blueprint artifact
108- uses : actions/upload-pages-artifact@v1
104+ uses : actions/upload-pages-artifact@v3
109105 with :
110- path : docs /_site
106+ path : website /_site
111107
112108 - name : Deploy to GitHub Pages
113109 id : deployment
114- uses : actions/deploy-pages@v1
115-
116- # - name: Check declarations
117- # run: |
118- # ~/.elan/bin/lake exe checkdecls blueprint/lean_decls
110+ uses : actions/deploy-pages@v4
119111
120112 - name : Make sure the cache works
121113 run : |
122- mv docs/docs .lake/build/doc
114+ mkdir -p docbuild/.lake/build/doc
115+ mv website/docs docbuild/.lake/build/doc
0 commit comments