Skip to content

Commit fe82273

Browse files
committed
chore: fix CI
1 parent 6faddd7 commit fe82273

File tree

1 file changed

+49
-99
lines changed

1 file changed

+49
-99
lines changed

.github/workflows/blueprint.yml

Lines changed: 49 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -3,118 +3,68 @@ name: Compile blueprint
33
on:
44
push:
55
branches:
6-
- main # Trigger on pushes to the default branch
7-
workflow_dispatch: # Allow manual triggering of the workflow from the GitHub Actions interface
6+
- main
7+
paths:
8+
- '**/*.lean'
9+
- '**/blueprint.yml'
10+
- 'blueprint/**'
11+
- 'home_page/**'
12+
- 'lean-toolchain'
13+
- 'lakefile.toml'
14+
- 'lake-manifest.json'
15+
pull_request:
16+
branches:
17+
- main
18+
paths:
19+
- '**/*.lean'
20+
- '**/blueprint.yml'
21+
- 'blueprint/**'
22+
- 'home_page/**'
23+
- 'lean-toolchain'
24+
- 'lakefile.toml'
25+
- 'lake-manifest.json'
26+
workflow_dispatch: # Allow manual triggering of the workflow from the GitHub Actions interface
27+
28+
# Cancel previous runs if a new commit is pushed to the same PR or branch
29+
concurrency:
30+
group: ${{ github.ref }} # Group runs by the ref (branch or PR)
31+
cancel-in-progress: true # Cancel any ongoing runs in the same group
832

933
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1034
permissions:
11-
contents: read # Read access to repository contents
12-
pages: write # Write access to GitHub Pages
13-
id-token: write # Write access to ID tokens
35+
contents: read # Read access to repository contents
36+
pages: write # Write access to GitHub Pages
37+
id-token: write # Write access to ID tokens
38+
issues: write # Write access to issues
39+
pull-requests: write # Write access to pull requests
1440

1541
jobs:
1642
build_project:
1743
runs-on: ubuntu-latest
1844
name: Build project
1945
steps:
46+
- name: Cleanup to free disk space
47+
uses: jlumbroso/free-disk-space@main
48+
with:
49+
tool-cache: false
50+
android: true # saves approximately 12 GB
51+
dotnet: false
52+
haskell: false
53+
large-packages: false
54+
docker-images: false
55+
swap-storage: false
2056
- name: Checkout project
21-
uses: actions/checkout@v5
57+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2258
with:
2359
fetch-depth: 0 # Fetch all history for all branches and tags
2460

25-
- name: Install elan
26-
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y
27-
28-
- name: Get Mathlib cache
29-
run: ~/.elan/bin/lake exe cache get || true
30-
31-
- name: Build project
32-
run: ~/.elan/bin/lake build LeanBridge
33-
34-
- name: Cache mathlib API docs
35-
uses: actions/cache@v4
36-
with:
37-
path: |
38-
.lake/build/doc/Init
39-
.lake/build/doc/Lake
40-
.lake/build/doc/Lean
41-
.lake/build/doc/Std
42-
.lake/build/doc/Mathlib
43-
.lake/build/doc/declarations
44-
.lake/build/doc/find
45-
.lake/build/doc/*.*
46-
!.lake/build/doc/declarations/declaration-data-LeanBridge*
47-
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }}
48-
restore-keys: MathlibDoc-
49-
50-
- name: Build project API documentation
51-
run: ~/.elan/bin/lake -R -Kenv=dev build LeanBridge:docs
52-
53-
- name: Check for `home_page` folder # this is meant to detect a Jekyll-based website
54-
id: check_home_page
55-
run: |
56-
if [ -d home_page ]; then
57-
echo "The 'home_page' folder exists in the repository."
58-
echo "HOME_PAGE_EXISTS=true" >> $GITHUB_ENV
59-
else
60-
echo "The 'home_page' folder does not exist in the repository."
61-
echo "HOME_PAGE_EXISTS=false" >> $GITHUB_ENV
62-
fi
63-
64-
- name: Build blueprint and copy to `home_page/blueprint`
65-
uses: xu-cheng/texlive-action@v3
61+
- name: Build the project
62+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
6663
with:
67-
docker_image: ghcr.io/xu-cheng/texlive-full:20231201
68-
run: |
69-
# Install necessary dependencies and build the blueprint
70-
apk update
71-
apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev
72-
git config --global --add safe.directory $GITHUB_WORKSPACE
73-
git config --global --add safe.directory `pwd`
74-
python3 -m venv env
75-
source env/bin/activate
76-
pip install --upgrade pip requests wheel
77-
pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
78-
pip install leanblueprint
79-
leanblueprint pdf
80-
mkdir -p home_page
81-
cp blueprint/print/print.pdf home_page/blueprint.pdf
82-
leanblueprint web
83-
cp -r blueprint/web home_page/blueprint
64+
use-github-cache: false
8465

85-
- name: Check declarations mentioned in the blueprint exist in Lean code
86-
run: |
87-
~/.elan/bin/lake exe checkdecls blueprint/lean_decls
88-
89-
- name: Copy API documentation to `home_page/docs`
90-
run: cp -r .lake/build/doc home_page/docs
91-
92-
- name: Remove unnecessary lake files from documentation in `home_page/docs`
93-
run: |
94-
find home_page/docs -name "*.trace" -delete
95-
find home_page/docs -name "*.hash" -delete
96-
97-
- name: Bundle dependencies
98-
uses: ruby/setup-ruby@v1
99-
with:
100-
working-directory: home_page
101-
ruby-version: "3.0" # Specify Ruby version
102-
bundler-cache: true # Enable caching for bundler
103-
104-
- name: Build website using Jekyll
105-
if: env.HOME_PAGE_EXISTS == 'true'
106-
working-directory: home_page
107-
run: JEKYLL_ENV=production bundle exec jekyll build # Note this will also copy the blueprint and API doc into home_page/_site
108-
109-
- name: "Upload website (API documentation, blueprint and any home page)"
110-
uses: actions/upload-pages-artifact@v4
66+
- name: Compile blueprint and documentation
67+
uses: leanprover-community/docgen-action@deed0cdc44dd8e5de07a300773eb751d33e32fc8 # 2025-10-26
11168
with:
112-
path: ${{ env.HOME_PAGE_EXISTS == 'true' && 'home_page/_site' || 'home_page/' }}
113-
114-
- name: Deploy to GitHub Pages
115-
id: deployment
116-
uses: actions/deploy-pages@v4
117-
118-
- name: Make sure the API documentation cache works
119-
run: mv home_page/docs .lake/build/doc
120-
69+
blueprint: true
70+
homepage: home_page

0 commit comments

Comments
 (0)