Skip to content

Commit 52695b4

Browse files
committed
Use leanprover-community/docgen-action
1 parent 69373bc commit 52695b4

File tree

5 files changed

+33
-190
lines changed

5 files changed

+33
-190
lines changed

.github/workflows/push.yml

Lines changed: 18 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- master
7+
pull_request:
8+
workflow_dispatch:
79

810
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
911
permissions:
@@ -30,97 +32,40 @@ jobs:
3032
run: |
3133
! (find PersistentDecomp/Mathlib -name "*.lean" -type f -print0 | xargs -0 grep -E -n '^import PersistentDecomp.(?!Mathlib)')
3234
33-
build_project:
34-
runs-on: ubuntu-latest
35+
build:
3536
name: Build project
37+
runs-on: ubuntu-latest
3638
steps:
37-
38-
# The following actions make sure the project builds properly.
39-
4039
- name: Checkout project
41-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4241
with:
43-
fetch-depth: 0
44-
45-
- name: Install elan
46-
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:4.18.0
47-
48-
- name: Get cache
49-
run: ~/.elan/bin/lake exe cache get || true
42+
fetch-depth: 0 # Fetch all history for all branches and tags
5043

51-
- name: Build project
52-
run: ~/.elan/bin/lake build PersistentDecomp
53-
54-
- name: Cache documentation
55-
uses: actions/cache@v4
56-
with:
57-
path: |
58-
website/docs
59-
!website/docs/PersistentDecomp
60-
key: Doc-${{ hashFiles('lake-manifest.json') }}
61-
restore-keys: Doc-
62-
63-
- name: Build documentation
64-
run: scripts/build_docs.sh
65-
66-
# - name: Build blueprint
67-
# uses: xu-cheng/texlive-action@v2
68-
# with:
69-
# docker_image: ghcr.io/xu-cheng/texlive-full:20231201
70-
# run: |
71-
# # Install necessary dependencies and build the blueprint
72-
# apk update
73-
# apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev
74-
# git config --global --add safe.directory $GITHUB_WORKSPACE
75-
# git config --global --add safe.directory `pwd`
76-
# python3 -m venv env
77-
# source env/bin/activate
78-
# pip install --upgrade pip requests wheel
79-
# pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
80-
# pip install leanblueprint
81-
# leanblueprint pdf
82-
# leanblueprint web
83-
84-
# The following actions create and deploy the website.
85-
86-
- name: Copy documentation to website/docs
87-
run: mv docs/build/* website/docs
88-
89-
# - name: Copy blueprint to website/blueprint
90-
# run: |
91-
# cp blueprint/print/print.pdf website/blueprint.pdf
92-
# cp -r blueprint/web website/blueprint
44+
- name: Build and lint the project
45+
id: build-lean
46+
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # v1.2.0
9347

9448
- name: Copy README.md to website/index.md
49+
if: github.ref == 'refs/heads/master'
9550
run: cp README.md website/index.md
9651

9752
- name: Upstreaming dashboard
53+
if: github.ref == 'refs/heads/master'
9854
run: |
9955
mkdir -p website/_includes
10056
python3 scripts/upstreaming_dashboard.py
10157
10258
- name: File dependencies
59+
if: github.ref == 'refs/heads/master'
10360
run: |
10461
sudo apt-get update
10562
sudo apt install graphviz -y
10663
~/.elan/bin/lake exe graph website/file_deps.pdf
10764
108-
- name: Bundle dependencies
109-
uses: ruby/setup-ruby@v1
65+
- name: Build project documentation
66+
if: github.ref == 'refs/heads/master'
67+
id: build-docgen
68+
uses: leanprover-community/docgen-action@main
11069
with:
111-
working-directory: website
112-
ruby-version: "3.1" # Not needed with a .ruby-version file
113-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
114-
115-
- name: Bundle website
116-
working-directory: website
117-
run: JEKYLL_ENV=production bundle exec jekyll build
118-
119-
- name: Upload docs & blueprint artifact
120-
uses: actions/upload-pages-artifact@v3
121-
with:
122-
path: website/_site
123-
124-
- name: Deploy to GitHub Pages
125-
id: deployment
126-
uses: actions/deploy-pages@v4
70+
blueprint: true
71+
homepage: "website"

.github/workflows/push_pr.yml

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

lake-manifest.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
{"version": "1.1.0",
22
"packagesDir": ".lake/packages",
33
"packages":
4-
[{"url": "https://github.com/leanprover-community/mathlib4.git",
4+
[{"url": "https://github.com/PatrickMassot/checkdecls.git",
5+
"type": "git",
6+
"subDir": null,
7+
"scope": "",
8+
"rev": "3d425859e73fcfbef85b9638c2a91708ef4a22d4",
9+
"name": "checkdecls",
10+
"manifestFile": "lake-manifest.json",
11+
"inputRev": null,
12+
"inherited": false,
13+
"configFile": "lakefile.lean"},
14+
{"url": "https://github.com/leanprover-community/mathlib4.git",
515
"type": "git",
616
"subDir": null,
717
"scope": "",

lakefile.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@ name = "mathlib"
4141
git = "https://github.com/leanprover-community/mathlib4.git"
4242
rev = "v4.25.0"
4343

44+
[[require]]
45+
name = "checkdecls"
46+
git = "https://github.com/PatrickMassot/checkdecls.git"
47+
4448
[[lean_lib]]
4549
name = "PersistentDecomp"

scripts/build_docs.sh

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

0 commit comments

Comments
 (0)