Skip to content

Commit 37726f0

Browse files
author
leanprover-community-mathlib4-bot
committed
Trigger CI for leanprover/lean4#2484
2 parents b792571 + 49ab8f2 commit 37726f0

2,970 files changed

Lines changed: 154178 additions & 72872 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docker/gitpod/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FROM ubuntu:jammy
66

77
USER root
88

9-
RUN apt-get update && apt-get install sudo git curl git bash-completion python3 -y && apt-get clean
9+
RUN apt-get update && apt-get install sudo git curl git bash-completion python3 python3-requests -y && apt-get clean
1010

1111
RUN useradd -l -u 33333 -G sudo -md /home/gitpod -s /bin/bash -p gitpod gitpod \
1212
# passwordless sudo for users in the 'sudo' group

.github/CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please see [our contribution guide](https://leanprover-community.github.io/contribute/index.html) on our website.

.github/workflows/bors.yml

Lines changed: 109 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ jobs:
3737
3838
- uses: actions/checkout@v3
3939

40-
- name: Install bibtool
41-
if: ${{ 'bors' == 'ubuntu-latest' }}
42-
run: |
43-
sudo apt-get update
44-
sudo apt-get install -y bibtool
40+
# Run the case checker action
41+
- name: Check Case Sensitivity
42+
uses: credfeto/action-case-checker@v1.3.0
43+
44+
- name: Look for ignored files
45+
uses: credfeto/action-no-ignored-files@v1.1.0
4546

4647
- name: install Python
4748
if: ${{ 'bors' == 'ubuntu-latest' }}
@@ -53,6 +54,12 @@ jobs:
5354
run: |
5455
./scripts/lint-style.sh
5556
57+
- name: Install bibtool
58+
if: ${{ 'bors' == 'ubuntu-latest' }}
59+
run: |
60+
sudo apt-get update
61+
sudo apt-get install -y bibtool
62+
5663
- name: lint references.bib
5764
run: |
5865
./scripts/lint-bib.sh
@@ -91,6 +98,25 @@ jobs:
9198
- name: check that all files are imported
9299
run: git diff --exit-code
93100

101+
check_workflows:
102+
if: github.repository == 'leanprover-community/mathlib4'
103+
name: check workflows
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: cleanup
107+
run: |
108+
find . -name . -o -prune -exec rm -rf -- {} +
109+
110+
- uses: actions/checkout@v3
111+
112+
- name: update workflows
113+
run: |
114+
cd .github/workflows/
115+
./mk_build_yml.sh
116+
117+
- name: check that workflows were consistent
118+
run: git diff --exit-code
119+
94120
build:
95121
if: github.repository == 'leanprover-community/mathlib4'
96122
name: Build
@@ -99,6 +125,10 @@ jobs:
99125
- name: cleanup
100126
run: |
101127
find . -name . -o -prune -exec rm -rf -- {} +
128+
# Delete all but the 5 most recent toolchains.
129+
# Make sure to delete both the `~/.elan/toolchains/X` directory and the `~/.elan/update-hashes/X` file.
130+
# Skip symbolic links (`-type d`), the current directory (`! -name .`), and `nightly` and `stable`.
131+
cd ~/.elan/toolchains && find . -maxdepth 1 -type d ! -name . -print0 | xargs -0 ls -1td | grep -v 'nightly$' | grep -v 'stable$' | tail -n +6 | xargs -I {} sh -c 'echo {} && rm -rf "{}" && rm "../update-hashes/{}"' || true
102132
103133
# The Hoskinson runners may not have jq installed, so do that now.
104134
- name: 'Setup jq'
@@ -107,7 +137,7 @@ jobs:
107137
- name: install elan
108138
run: |
109139
set -o pipefail
110-
curl -sSfL https://github.com/leanprover/elan/releases/download/v1.4.2/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
140+
curl -sSfL https://github.com/leanprover/elan/releases/download/v3.0.0/elan-x86_64-unknown-linux-gnu.tar.gz | tar xz
111141
./elan-init -y --default-toolchain none
112142
echo "$HOME/.elan/bin" >> $GITHUB_PATH
113143
@@ -126,10 +156,18 @@ jobs:
126156
elan toolchain uninstall `cat lean-toolchain`
127157
fi
128158
159+
- name: print lean and lake versions
160+
run: |
161+
lean --version
162+
lake --version
163+
129164
- name: get cache
130165
run: |
131166
lake exe cache clean
132-
lake exe cache get
167+
# We've been seeing many failures at this step recently because of network errors.
168+
# As a band-aid, we try twice.
169+
# The 'sleep 1' is small pause to let the network recover.
170+
lake exe cache get || (sleep 1; lake exe cache get)
133171
134172
- name: build mathlib
135173
id: build
@@ -141,50 +179,106 @@ jobs:
141179
142180
- name: check for noisy stdout lines
143181
run: |
144-
! grep "stdout:" stdout.log
182+
! grep --after-context=1 "stdout:" stdout.log
145183
146184
- name: build library_search cache
147185
run: lake build -KCI MathlibExtras
148186

149187
- name: upload cache
150188
if: always()
151189
run: |
190+
# run this in CI if it gets an incorrect lake hash for existing cache files somehow
191+
# lake exe cache pack! || true
152192
lake exe cache commit || true
153-
lake exe cache put || true
193+
# try twice in case of network errors
194+
lake exe cache put || (sleep 1; lake exe cache put) || true
154195
env:
155196
MATHLIB_CACHE_SAS: ${{ secrets.MATHLIB_CACHE_SAS }}
156197

198+
- name: check the cache
199+
run: |
200+
# Because the `lean-pr-testing-NNNN` branches use toolchains that are "updated in place"
201+
# the cache mechanism is unreliable, so we don't test it if we are on such a branch.
202+
if [[ ! `cat lean-toolchain` =~ ^leanprover/lean4-pr-releases:pr-release-[0-9]+$ ]]; then
203+
lake exe cache get || (sleep 1; lake exe cache get)
204+
# We pipe the output of `lake build` to a file,
205+
# and if we find " Building Mathlib" in that file we kill `lake build`, and error.
206+
lake build > tmp & tail --pid=$! -n +1 -F tmp | (! (grep -m 1 " Building Mathlib" && kill $! ))
207+
fi
208+
157209
- name: build archive
158-
run: lake build Archive
210+
run: |
211+
# Note: we should not be including `Archive` and `Countexamples` in the cache.
212+
# We do this for now for the sake of not rebuilding them in every CI run
213+
# even when they are not touched.
214+
# Since `Archive` and `Counterexamples` files have very simple dependencies,
215+
# it should be possible to determine whether they need to be built without actually
216+
# storing and transferring oleans over the network.
217+
# Hopefully a future re-implementation of `cache` will obviate the present need for this hack.
218+
# We retry twice in case of network errors.
219+
lake exe cache get Archive.lean || (sleep 1; lake exe cache get Archive.lean)
220+
lake build Archive
221+
lake exe cache put Archive.lean || (sleep 1; lake exe cache put Archive.lean)
222+
env:
223+
MATHLIB_CACHE_SAS: ${{ secrets.MATHLIB_CACHE_SAS }}
159224

160225
- name: build counterexamples
161-
run: lake build Counterexamples
226+
run: |
227+
lake exe cache get Counterexamples.lean || (sleep 1; lake exe cache get Counterexamples.lean)
228+
lake build Counterexamples
229+
lake exe cache put Counterexamples.lean || (sleep 1; lake exe cache put Counterexamples.lean)
230+
env:
231+
MATHLIB_CACHE_SAS: ${{ secrets.MATHLIB_CACHE_SAS }}
162232

163233
- name: check declarations in db files
164234
run: |
165235
python3 scripts/yaml_check.py docs/100.yaml docs/overview.yaml docs/undergrad.yaml
166-
build/bin/checkYaml
236+
lake exe checkYaml
237+
238+
- name: verify `lake exe graph` works
239+
run: |
240+
lake exe graph
241+
rm import_graph.dot
167242
168243
- name: test mathlib
169244
id: test
170-
run: make -j 8 test
245+
run: |
246+
# Tests use parts of ProofWidgets not imported by Mathlib.
247+
# Ensure everything has been built.
248+
lake build ProofWidgets
249+
make -j 8 test
171250
172251
- name: lint mathlib
173252
id: lint
174253
uses: liskin/gh-problem-matcher-wrap@v2
175254
with:
176255
linters: gcc
177-
run: env LEAN_ABORT_ON_PANIC=1 make lint
256+
run: env LEAN_ABORT_ON_PANIC=1 lake exe runLinter Mathlib
257+
258+
- name: check environments using lean4checker
259+
id: lean4checker
260+
run: |
261+
git clone https://github.com/leanprover/lean4checker
262+
cd lean4checker
263+
git checkout toolchain/v4.3.0
264+
# Now that the git hash is embedded in each olean,
265+
# we need to compile lean4checker on the same toolchain
266+
cp ../lean-toolchain .
267+
lake build
268+
./test.sh
269+
cd ..
270+
lake env lean4checker/.lake/build/bin/lean4checker
178271
179272
- name: Post comments for lean-pr-testing branch
180273
if: always()
181274
env:
182275
TOKEN: ${{ secrets.LEAN_PR_TESTING }}
183276
GITHUB_CONTEXT: ${{ toJson(github) }}
184-
WORKFLOW_URL: ${{ github.event.workflow_run.html_url }}
277+
WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
185278
LINT_OUTCOME: ${{ steps.lint.outcome }}
186279
TEST_OUTCOME: ${{ steps.test.outcome }}
187280
BUILD_OUTCOME: ${{ steps.build.outcome }}
281+
CHECK_OUTCOME: ${{ steps.lean4checker.outcome }}
188282
run: |
189283
scripts/lean-pr-testing-comments.sh
190284

0 commit comments

Comments
 (0)