Update mathlib3 one last time (to port-complete) #129
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
pull_request: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
jobs: | |
update_lean_xyz_branch_and_build: | |
runs-on: ubuntu-latest | |
name: Build project | |
steps: | |
- name: checkout project | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: update branch | |
if: github.ref == 'refs/heads/master' | |
uses: leanprover-contrib/update-versions-action@master | |
- 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@v1 | |
with: | |
python-version: 3.8 | |
- name: Install leanproject | |
run: | | |
python3 -m pip install --user pipx | |
python3 -m pipx ensurepath | |
source ~/.profile | |
pipx install mathlibtools | |
- 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@v1 | |
with: | |
python-version: 3.8 | |
- 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: Lint | |
run: | | |
! (_target/deps/mathlib/scripts/lint-style.py $(find src -name '*.lean') || true) | (grep -vE 'ERR_COP|ERR_LIN' || true) | grep '^' | |
- name: Build | |
run: | | |
# hack: remove the `sys.exit` for noisy files | |
head -n -1 _target/deps/mathlib/scripts/detect_errors.py > detect_errors.py | |
lean --json --make src | python3 detect_errors.py | |
- name: Save olean cache | |
run: | | |
leanproject mk-cache | |
- name: Make progress bar | |
run: | | |
mkdir build | |
lean --make analyze.lean | |
lean --run analyze.lean > build/progress_bar.svg | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: 'build' | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/master' | |
id: deployment | |
uses: actions/deploy-pages@v1 |