Skip to content

Commit

Permalink
Copy over workflow changes from LeanCamCombi
Browse files Browse the repository at this point in the history
  • Loading branch information
YaelDillies committed Jan 9, 2025
1 parent 95f4e12 commit aa22b06
Show file tree
Hide file tree
Showing 17 changed files with 213 additions and 116 deletions.
72 changes: 31 additions & 41 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Build Lean project

on:
push:
branches:
Expand Down Expand Up @@ -30,19 +32,14 @@ jobs:
steps:
- name: Checkout project
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Copy README.md to website/index.md
run: cp README.md website/index.md

- name: Print files to upstream
run: |
grep -r --files-without-match 'import LeanAPAP' LeanAPAP | sort > 1.txt
grep -r --files-with-match 'sorry' LeanAPAP | sort > 2.txt
mkdir -p docs/_includes
comm -23 1.txt 2.txt | sed -e 's/^\(.*\)$/- [`\1`](https:\/\/github.com\/YaelDillies\/LeanAPAP\/blob\/master\/\1)/' > docs/_includes/files_to_upstream.md
rm 1.txt 2.txt
- name: Count sorries
run: python scripts/count_sorry.py
mkdir -p website/_includes
python3 scripts/upstreaming_dashboard.py
- name: Install elan
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:4.5.0
Expand All @@ -53,61 +50,54 @@ jobs:
- name: Build project
run: ~/.elan/bin/lake build LeanAPAP

- name: Cache mathlib docs
- name: Cache dependencies docs
uses: actions/cache@v3
with:
path: |
.lake/build/doc/Init
.lake/build/doc/Lake
.lake/build/doc/Lean
.lake/build/doc/Std
.lake/build/doc/Mathlib
.lake/build/doc/declarations
path: docbuild/.lake/build/doc
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }}
restore-keys: |
MathlibDoc-
- name: Build documentation
run: ~/.elan/bin/lake -R -Kenv=dev build LeanAPAP:docs
working-directory: docbuild
run: |
~/.elan/bin/lake exe cache get || true
~/.elan/bin/lake build LeanAPAP:docs
- name: Build blueprint and copy to `docs/blueprint`
- name: Build blueprint and copy to `website/blueprint`
uses: xu-cheng/texlive-action@v2
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20231201
scheme: full
run: |
apk update
apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory `pwd`
python3 -m venv env
source env/bin/activate
pip install --upgrade pip requests wheel
pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
pip install leanblueprint
leanblueprint pdf
cp blueprint/print/print.pdf docs/blueprint.pdf
leanblueprint web
cp -r blueprint/web docs/blueprint
- name: Move documentation to `docs/docs`
python3 -m pip install --upgrade pip requests wheel
python3 -m pip install pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
pip install -r blueprint/requirements.txt
python3 -m pip install invoke
inv all
- name: Copy documentation to `website/docs`
run: |
mv .lake/build/doc docs/docs
mv docbuild/.lake/build/doc website/docs
- name: Bundle dependencies
uses: ruby/setup-ruby@v1
with:
working-directory: docs
ruby-version: "3.0" # Specify Ruby version
bundler-cache: true # Enable caching for bundler
working-directory: website
ruby-version: "3.0" # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

- name: Build website using Jekyll
working-directory: docs
run: JEKYLL_ENV=production bundle exec jekyll build # Note this will also copy the blueprint and API doc into docs/_site
- name: Bundle website
working-directory: website
run: JEKYLL_ENV=production bundle exec jekyll build

- name: Upload docs & blueprint artifact
uses: actions/upload-pages-artifact@v1
with:
path: docs/_site
path: website/_site

- name: Deploy to GitHub Pages
id: deployment
Expand All @@ -119,4 +109,4 @@ jobs:

- name: Make sure the cache works
run: |
mv docs/docs .lake/build/doc
mv website/docs docbuild/.lake/build/doc
142 changes: 142 additions & 0 deletions docbuild/lake-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{"version": "1.1.0",
"packagesDir": "../.lake/packages",
"packages":
[{"url": "https://github.com/leanprover/doc-gen4",
"type": "git",
"subDir": null,
"scope": "leanprover",
"rev": "0291556f04e89d46cd2999f0f4c1164c81778207",
"name": "«doc-gen4»",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.15.0",
"inherited": false,
"configFile": "lakefile.lean"},
{"type": "path",
"scope": "",
"name": "LeanAPAP",
"manifestFile": "lake-manifest.json",
"inherited": false,
"dir": "./../",
"configFile": "lakefile.lean"},
{"url": "https://github.com/mhuisi/lean4-cli",
"type": "git",
"subDir": null,
"scope": "",
"rev": "0c8ea32a15a4f74143e4e1e107ba2c412adb90fd",
"name": "Cli",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/fgdorais/lean4-unicode-basic",
"type": "git",
"subDir": null,
"scope": "",
"rev": "470c41643209208d325a5a7315116f293c7443fb",
"name": "UnicodeBasic",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/dupuisf/BibtexQuery",
"type": "git",
"subDir": null,
"scope": "",
"rev": "46376bc3c8f46ac1a1fd7712856b0f7bd6166098",
"name": "BibtexQuery",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/acmepjz/md4lean",
"type": "git",
"subDir": null,
"scope": "",
"rev": "f8ed91f3a9d806648ae6a03ab98c8b87e8bedc7e",
"name": "MD4Lean",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/mathlib4.git",
"type": "git",
"subDir": null,
"scope": "",
"rev": "9082fa7b9f7bcad5b4b6052a629eb9347580073a",
"name": "mathlib",
"manifestFile": "lake-manifest.json",
"inputRev": null,
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/plausible",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "8e5cb8d424df462f84997dd68af6f40e347c3e35",
"name": "plausible",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.15.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/LeanSearchClient",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "003ff459cdd85de551f4dcf95cdfeefe10f20531",
"name": "LeanSearchClient",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/import-graph",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "ed3b856bd8893ade75cafe13e8544d4c2660f377",
"name": "importGraph",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.15.0-rc1",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/ProofWidgets4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "2b000e02d50394af68cfb4770a291113d94801b5",
"name": "proofwidgets",
"manifestFile": "lake-manifest.json",
"inputRev": "v0.0.48",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/aesop",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "a4a08d92be3de00def5298059bf707c72dfd3c66",
"name": "aesop",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inherited": true,
"configFile": "lakefile.toml"},
{"url": "https://github.com/leanprover-community/quote4",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "ad942fdf0b15c38bface6acbb01d63855a2519ac",
"name": "Qq",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.14.0",
"inherited": true,
"configFile": "lakefile.lean"},
{"url": "https://github.com/leanprover-community/batteries",
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "f007bfe46ea8fb801ec907df9ab540054abcc5fd",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
"inherited": true,
"configFile": "lakefile.toml"}],
"name": "docbuild",
"lakeDir": ".lake"}
13 changes: 13 additions & 0 deletions docbuild/lakefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name = "docbuild"
reservoir = false
version = "0.1.0"
packagesDir = "../.lake/packages"

[[require]]
name = "LeanAPAP"
path = "../"

[[require]]
scope = "leanprover"
name = "doc-gen4"
rev = "v4.15.0"
1 change: 1 addition & 0 deletions docbuild/lean-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
leanprover/lean4:v4.15.0-rc1
Loading

0 comments on commit aa22b06

Please sign in to comment.