Skip to content

Commit

Permalink
Speed up CI (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
pitmonticone authored Aug 14, 2024
1 parent 8c1eed7 commit 0b365f9
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 7 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
.lake/build/doc/Std
.lake/build/doc/Mathlib
.lake/build/doc/declarations
.lake/build/doc/find
.lake/build/doc/*.*
!.lake/build/doc/declarations/declaration-data-BonnAnalysis*
key: MathlibDoc-${{ hashFiles('lake-manifest.json') }}
restore-keys: MathlibDoc-
Expand Down Expand Up @@ -78,16 +80,19 @@ jobs:
leanblueprint web
cp -r blueprint/web docs/blueprint
- name: Remove lake files from documentation
run: |
find .lake/build/doc -name "*.trace" -delete
find .lake/build/doc -name "*.hash" -delete
# - name: Check declarations
# run: ~/.elan/bin/lake exe checkdecls blueprint/lean_decls

- name: Copy documentation to `docs/docs`
run: |
sudo chown -R runner docs
cp -r .lake/build/doc docs/docs
- name: Remove lake files from documentation in `docs/docs`
run: |
find docs/docs -name "*.trace" -delete
find docs/docs -name "*.hash" -delete
- name: Bundle dependencies
uses: ruby/setup-ruby@v1
with:
Expand All @@ -113,5 +118,5 @@ jobs:
id: deployment
uses: actions/deploy-pages@v4

- name: Make sure the cache works
run: mv docs/docs .lake/build/doc
# - name: Make sure the cache works
# run: mv docs/docs .lake/build/doc
23 changes: 22 additions & 1 deletion .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,31 @@ jobs:
fetch-depth: 0

- name: Install elan
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain leanprover/lean4:4.0.0
run: curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- -y --default-toolchain none

- name: Get cache
run: ~/.elan/bin/lake exe cache get

- name: Build project
run: ~/.elan/bin/lake build BonnAnalysis

- name: Build blueprint and copy to `docs/blueprint`
uses: xu-cheng/texlive-action@v2
with:
docker_image: ghcr.io/xu-cheng/texlive-full:20231201
run: |
export PIP_BREAK_SYSTEM_PACKAGES=1
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
leanblueprint web
# - name: Check declarations
# run: ~/.elan/bin/lake exe checkdecls blueprint/lean_decls
10 changes: 10 additions & 0 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
"inputRev": null,
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/PatrickMassot/checkdecls.git",
"type": "git",
"subDir": null,
"scope": "",
"rev": "21a36f3c07a9229e1287483c16a0dd04e479ecc5",
"name": "checkdecls",
"manifestFile": "lake-manifest.json",
"inputRev": "master",
"inherited": false,
"configFile": "lakefile.lean"},
{"url": "https://github.com/acmepjz/md4lean",
"type": "git",
"subDir": null,
Expand Down
3 changes: 3 additions & 0 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ package «bonnAnalysis» where
require mathlib from git
"https://github.com/leanprover-community/mathlib4.git"

require checkdecls from git
"https://github.com/PatrickMassot/checkdecls.git" @ "master"

-- This is run only if we're in `dev` mode. This is so not everyone has to build doc-gen
meta if get_config? env = some "dev" then
require «doc-gen4» from git
Expand Down

0 comments on commit 0b365f9

Please sign in to comment.