forked from pygae/lean-ga
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (98 loc) · 3.19 KB
/
lean_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
on:
push:
# branches-ignore:
# - blueprint
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
jobs:
update_lean_xyz_branch_and_build:
runs-on: ubuntu-latest
name: Build project
steps:
- name: checkout project
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: update branch
if: github.ref == 'refs/heads/master'
uses: leanprover-contrib/update-versions-action@master
- name: Install elan
run: |
set -o pipefail
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh -s -- --default-toolchain none -y
~/.elan/bin/lean --version
echo "$HOME/.elan/bin" >> $GITHUB_PATH
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- name: Install leanproject
run: |
python3 -m pip install --user pipx
python3 -m pipx ensurepath
source ~/.profile
pipx install mathlibtools
- name: Set up olean cache
uses: actions/cache@v3
with:
path: _cache
key: oleans
- name: Configure
run: |
leanpkg configure
leanproject get-mathlib-cache
leanproject get-cache --fallback=download-first || true
- name: Build
run: |
set -o pipefail
# TODO: allow noisy files in a better way
lean --json --make src | (python3 _target/deps/mathlib/scripts/detect_errors.py || true)
- name: Save olean cache
run: |
leanproject mk-cache
- name: Export symbols
run: |
leanproject mk-all
lean --run export.lean > lean-decl-info.tex
- uses: actions/upload-artifact@v3
with:
name: lean-decl-info
path: lean-decl-info.tex
- name: Install blueprint apt deps with cache
uses: awalsh128/cache-apt-pkgs-action@latest
with:
# texlive-binaries is for kpsewhich, which is a dependency of plastex
packages: graphviz libgraphviz-dev pdf2svg dvisvgm texlive-binaries
version: 1.0
- uses: actions/cache@v3
name: Tectonic Cache
with:
path: ~/.cache/Tectonic
key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}
restore-keys: |
${{ runner.os }}-tectonic-
- uses: wtfjoke/setup-tectonic@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
biber-version: "latest"
- name: Install blueprint deps
run: |
pip install -r requirements.txt
pip install mathlibtools
- name: Build blueprint
run: |
inv all
- name: Deploy blueprint
if: contains('|refs/heads/master|refs/heads/blueprint|', github.ref)
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.github_token }}
# NOTE: web is inside docs/blueprint
publish_dir: ./blueprint/web
# NOTE: To avoid overwriting existing files in gh_pages, we deploy it to a subdirectory
destination_dir: blueprint