Skip to content

Commit 4547e81

Browse files
committed
Use action
1 parent 9c85622 commit 4547e81

File tree

1 file changed

+9
-94
lines changed

1 file changed

+9
-94
lines changed

.github/workflows/blueprint.yml

Lines changed: 9 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -23,103 +23,18 @@ jobs:
2323
name: Build project
2424
steps:
2525
- name: Checkout project
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
fetch-depth: 0 # Fetch all history for all branches and tags
2929

30-
- name: Install elan
31-
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y
32-
33-
- name: Get Mathlib cache
34-
run: ~/.elan/bin/lake exe cache get || true
35-
36-
- name: Build project
37-
run: ~/.elan/bin/lake build BlueprintDebug
38-
39-
- name: Cache API docs
40-
uses: actions/cache@v4
41-
with:
42-
path: |
43-
.lake/build/doc/Aesop
44-
.lake/build/doc/Batteries
45-
.lake/build/doc/find
46-
.lake/build/doc/Init
47-
.lake/build/doc/Lake
48-
.lake/build/doc/Lean
49-
.lake/build/doc/Mathlib
50-
.lake/build/doc/Std
51-
key: Docs-${{ hashFiles('lake-manifest.json') }}
52-
53-
- name: Build project API documentation
54-
run: ~/.elan/bin/lake -R -Kenv=dev build BlueprintDebug:docs
55-
56-
- name: Check for `home_page` folder # this is meant to detect a Jekyll-based website
57-
id: check_home_page
58-
run: |
59-
if [ -d home_page ]; then
60-
echo "The 'home_page' folder exists in the repository."
61-
echo "HOME_PAGE_EXISTS=true" >> $GITHUB_ENV
62-
else
63-
echo "The 'home_page' folder does not exist in the repository."
64-
echo "HOME_PAGE_EXISTS=false" >> $GITHUB_ENV
65-
fi
66-
67-
- name: Build blueprint and copy to `home_page/blueprint`
68-
uses: xu-cheng/texlive-action@v2
69-
with:
70-
docker_image: ghcr.io/xu-cheng/texlive-full:20250101
71-
run: |
72-
# Install necessary dependencies and build the blueprint
73-
apk update
74-
apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev
75-
git config --global --add safe.directory $GITHUB_WORKSPACE
76-
git config --global --add safe.directory `pwd`
77-
python3 -m venv env
78-
source env/bin/activate
79-
pip install --upgrade pip requests wheel
80-
pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
81-
pip install leanblueprint
82-
leanblueprint pdf
83-
mkdir -p home_page
84-
cp blueprint/print/print.pdf home_page/blueprint.pdf
85-
leanblueprint web
86-
cp -r blueprint/web home_page/blueprint
87-
88-
- name: Check declarations mentioned in the blueprint exist in Lean code
89-
run: |
90-
~/.elan/bin/lake exe checkdecls blueprint/lean_decls
91-
92-
- name: Copy API documentation to `home_page/docs`
93-
run: cp -r .lake/build/doc home_page/docs
94-
95-
- name: Remove unnecessary lake files from documentation in `home_page/docs`
96-
run: |
97-
find home_page/docs -name "*.trace" -delete
98-
find home_page/docs -name "*.hash" -delete
99-
100-
- name: Bundle dependencies
101-
uses: ruby/setup-ruby@v1
30+
- name: Build the project
31+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
10232
with:
103-
working-directory: home_page
104-
ruby-version: "3.0" # Specify Ruby version
105-
bundler-cache: true # Enable caching for bundler
33+
use-github-cache: false
10634

107-
- name: Build website using Jekyll
108-
if: env.HOME_PAGE_EXISTS == 'true'
109-
working-directory: home_page
110-
env:
111-
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112-
run: JEKYLL_ENV=production bundle exec jekyll build # Note this will also copy the blueprint and API doc into home_page/_site
113-
114-
- name: "Upload website (API documentation, blueprint and any home page)"
115-
uses: actions/upload-pages-artifact@v3
35+
- name: Compile blueprint and documentation
36+
uses: leanprover-community/docgen-action@deed0cdc44dd8e5de07a300773eb751d33e32fc8 # 2025-10-26
11637
with:
117-
path: ${{ env.HOME_PAGE_EXISTS == 'true' && 'home_page/_site' || 'home_page/' }}
118-
119-
- name: Deploy to GitHub Pages
120-
id: deployment
121-
uses: actions/deploy-pages@v4
122-
123-
- name: Make sure the API documentation cache works
124-
run: mv home_page/docs .lake/build/doc
125-
38+
api-docs: false
39+
blueprint: true
40+
homepage: home_page

0 commit comments

Comments
 (0)