Skip to content

Commit 29cabbe

Browse files
committed
Merge branch 'master' into WithBot_refactor
2 parents b5c4101 + 5db9169 commit 29cabbe

7,334 files changed

Lines changed: 102485 additions & 46115 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.

.github/build.in.yml

Lines changed: 79 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
concurrency:
1616
# label each workflow run; only the latest with each label will run
1717
# workflows on master get more expressive labels
18-
group: ${{ github.workflow }}-${{ github.ref }}-${{ (contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ (github.event_name == 'push' && contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
1919
# cancel any running workflow with the same label
2020
cancel-in-progress: true
2121

@@ -38,12 +38,23 @@ jobs:
3838
lint-outcome: ${{ steps.lint.outcome }}
3939
mk_all-outcome: ${{ steps.mk_all.outcome }}
4040
noisy-outcome: ${{ steps.noisy.outcome }}
41-
shake-outcome: ${{ steps.shake.outcome }}
41+
# shake-outcome: ${{ steps.shake.outcome }}
4242
test-outcome: ${{ steps.test.outcome }}
4343
defaults: # On Hoskinson runners, landrun is already installed.
44-
run:
44+
run: # note that .pr-branch/.lake must be created in a step below before we use this
4545
shell: landrun --rox /usr --ro /etc/timezone --rw /dev --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rox /home/lean/.cache/mathlib/ --rw pr-branch/.lake/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
4646
steps:
47+
- name: job info
48+
env:
49+
WORKFLOW: ${{ github.workflow }}
50+
PR_NUMBER: ${{ github.event.pull_request.number }}
51+
REF: ${{ github.ref }}
52+
EVENT_NAME: ${{ github.event_name }}
53+
RUN_ID: ${{ github.run_id }}
54+
CONCURRENCY_GROUP: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ (github.event_name == 'push' && contains(fromJSON('["refs/heads/master", "refs/heads/staging"]'), github.ref) && github.run_id) || '' }}
55+
shell: bash # there is no script body, so this is safe to "run" outside landrun.
56+
run: |
57+
# We just populate the env vars for this step to make them viewable in the logs
4758
- name: cleanup
4859
shell: bash # This *just* deletes old files, so is safe to run outside landrun.
4960
run: |
@@ -63,11 +74,11 @@ jobs:
6374
6475
# The Hoskinson runners may not have jq installed, so do that now.
6576
- name: 'Setup jq'
66-
uses: dcarbone/install-jq-action@f0e10f46ff84f4d32178b4b76e1ef180b16f82c3 # v3.1.1
77+
uses: dcarbone/install-jq-action@b7ef57d46ece78760b4019dbc4080a1ba2a40b45 # v3.2.0
6778

6879
# Checkout the master branch into a subdirectory
6980
- name: Checkout master branch
70-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
81+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
7182
with:
7283
# Recall that on the `leanprover-community/mathlib4-nightly-testing` repository,
7384
# we don't maintain a `master` branch at all.
@@ -77,7 +88,7 @@ jobs:
7788

7889
# Checkout the PR branch into a subdirectory
7990
- name: Checkout PR branch
80-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
91+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
8192
with:
8293
ref: "${{ PR_BRANCH_REF }}"
8394
path: pr-branch
@@ -227,6 +238,51 @@ jobs:
227238
echo "✅ All inputRevs in lake-manifest.json are valid"
228239
fi
229240
241+
- name: verify ProofWidgets lean-toolchain matches on versioned releases
242+
# Only enforce this on the main mathlib4 repository, not on nightly-testing
243+
if: github.repository == 'leanprover-community/mathlib4'
244+
shell: bash
245+
run: |
246+
cd pr-branch
247+
248+
# Read the lean-toolchain file
249+
TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
250+
echo "Lean toolchain: $TOOLCHAIN"
251+
252+
# Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
253+
if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
254+
echo "✓ Detected versioned Lean release: $TOOLCHAIN"
255+
echo "Verifying ProofWidgets lean-toolchain matches..."
256+
257+
# Check if ProofWidgets lean-toolchain exists
258+
if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
259+
echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
260+
echo "This file should be created by 'lake env' during dependency download."
261+
exit 1
262+
fi
263+
264+
# Read ProofWidgets lean-toolchain
265+
PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
266+
echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
267+
268+
# Compare the two
269+
if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
270+
echo "❌ Error: Lean toolchain mismatch!"
271+
echo " Main lean-toolchain: $TOOLCHAIN"
272+
echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
273+
echo ""
274+
echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
275+
echo "the ProofWidgets dependency must use the same toolchain."
276+
echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
277+
exit 1
278+
else
279+
echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
280+
fi
281+
else
282+
echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
283+
echo "Skipping ProofWidgets toolchain verification."
284+
fi
285+
230286
- name: get cache (1/3 - setup and initial fetch)
231287
id: get_cache_part1_setup
232288
shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun
@@ -295,6 +351,7 @@ jobs:
295351
echo "::endgroup::"
296352
297353
../master-branch/scripts/lake-build-with-retry.sh Mathlib
354+
# results of build at pr-branch/.lake/build_summary_Mathlib.json
298355
- name: end gh-problem-match-wrap for build step
299356
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
300357
with:
@@ -308,7 +365,7 @@ jobs:
308365
309366
- name: upload artifact containing contents of pr-branch
310367
# temporary measure for debugging no-build failures
311-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
368+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
312369
with:
313370
name: mathlib4_artifact
314371
include-hidden-files: true
@@ -363,13 +420,15 @@ jobs:
363420
run: |
364421
cd pr-branch
365422
../master-branch/scripts/lake-build-with-retry.sh Archive
423+
# results of build at pr-branch/.lake/build_summary_Archive.json
366424
367425
- name: build counterexamples
368426
id: counterexamples
369427
continue-on-error: true
370428
run: |
371429
cd pr-branch
372430
../master-branch/scripts/lake-build-with-retry.sh Counterexamples
431+
# results of build at pr-branch/.lake/build_summary_Counterexamples.json
373432
374433
- name: Check if building Archive or Counterexamples failed
375434
if: steps.archive.outcome == 'failure' || steps.counterexamples.outcome == 'failure'
@@ -398,7 +457,7 @@ jobs:
398457
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
399458

400459
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
401-
if: always()
460+
if: ${{ always() && steps.mk_all.outcome != 'skipped' }}
402461
run: |
403462
if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then
404463
echo "Please run 'lake exe mk_all' to regenerate the import all files"
@@ -416,7 +475,7 @@ jobs:
416475
id: test
417476
run: |
418477
cd pr-branch
419-
lake --iofail test
478+
../master-branch/scripts/lake-build-wrapper.py .lake/build_summary_MathlibTest.json lake --iofail test
420479
- name: end gh-problem-match-wrap for test step
421480
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
422481
with:
@@ -429,18 +488,20 @@ jobs:
429488
action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after.
430489
linters: gcc
431490

432-
- name: check for unused imports
433-
id: shake
434-
run: |
435-
cd pr-branch
436-
env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
491+
# With the arrival of the module system, the old `shake` is no longer functional.
492+
# This will be replaced soon.
493+
# - name: check for unused imports
494+
# id: shake
495+
# run: |
496+
# cd pr-branch
497+
# env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style
437498

438499
- name: lint mathlib
439500
if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }}
440501
id: lint
441502
run: |
442503
cd pr-branch
443-
env LEAN_ABORT_ON_PANIC=1 lake exe runLinter Mathlib
504+
env LEAN_ABORT_ON_PANIC=1 ../master-branch/scripts/lake-build-wrapper.py .lake/build_summary_lint.json lake exe runLinter Mathlib
444505
445506
- name: end gh-problem-match-wrap for shake and lint steps
446507
uses: leanprover-community/gh-problem-matcher-wrap@20007cb926a46aa324653a387363b52f07709845 # 2025-04-23
@@ -491,12 +552,12 @@ jobs:
491552
runs-on: ubuntu-latest # Note these steps run on disposable GitHub runners, so no landrun sandboxing is needed.
492553
steps:
493554

494-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
555+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
495556
with:
496557
ref: "${{ PR_BRANCH_REF }}"
497558

498559
- name: Configure Lean
499-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
560+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
500561
with:
501562
auto-config: false # Don't run `lake build`, `lake test`, or `lake lint` automatically.
502563
use-github-cache: false
@@ -539,7 +600,7 @@ jobs:
539600
lake exe graph
540601
541602
- name: upload the import graph
542-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
603+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
543604
with:
544605
name: import-graph
545606
path: import_graph.dot

.github/workflows/PR_summary.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717

1818
steps:
1919
- name: Checkout code
20-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
with:
2222
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
2424
path: pr-branch
2525

2626
# Checkout the master branch into a subdirectory
2727
- name: Checkout master branch
28-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2929
with:
3030
# When testing the scripts, comment out the "ref: master"
3131
ref: master
@@ -60,7 +60,7 @@ jobs:
6060
fi
6161
6262
- name: Set up Python
63-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
63+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
6464
with:
6565
python-version: 3.12
6666

.github/workflows/actionlint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout
13-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414

1515
- name: suggester / actionlint
16-
uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
16+
uses: reviewdog/action-actionlint@f00ad0691526c10be4021a91b2510f0a769b14d0 # v1.68.0
1717
with:
1818
tool_name: actionlint
1919
fail_level: error
@@ -22,15 +22,15 @@ jobs:
2222
name: check workflows generated by build.in.yml
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626

2727
- name: update workflows
2828
run: |
2929
cd .github/workflows/
3030
./mk_build_yml.sh
3131
3232
- name: suggester / build.in.yml
33-
uses: reviewdog/action-suggester@4747dbc9f9e37adba0943e681cc20db466642158 # v1.21.0
33+
uses: reviewdog/action-suggester@aa38384ceb608d00f84b4690cacc83a5aba307ff # v1.24.0
3434
with:
3535
tool_name: mk_build_yml.sh
3636
fail_level: error

.github/workflows/add_label_from_diff.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ jobs:
2222
if: github.repository == 'leanprover-community/mathlib4'
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626
with:
2727
ref: ${{ github.event.pull_request.head.sha }}
2828
fetch-depth: 0
2929
- name: Configure Lean
30-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
30+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
3131
with:
3232
auto-config: false
3333
use-github-cache: false

.github/workflows/auto_assign_reviewers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ jobs:
1111
name: assign automatically proposed reviewers
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1515
with:
1616
ref: master
1717
sparse-checkout: |
1818
scripts/assign_reviewers.py
1919
2020
- name: Set up Python
21-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
21+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
2222
with:
2323
python-version: '3.x'
2424

.github/workflows/bench_summary_comment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
if: github.event.issue.pull_request && (startsWith(github.event.comment.body, 'Here are the [benchmark results]'))
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
13+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
1414
with:
1515
ref: master
1616
sparse-checkout: |
1717
scripts/bench_summary.lean
1818
1919
- name: Configure Lean
20-
uses: leanprover/lean-action@f807b338d95de7813c5c50d018f1c23c9b93b4ec # 2025-04-24
20+
uses: leanprover/lean-action@434f25c2f80ded67bba02502ad3a86f25db50709 # v1.3.0
2121
with:
2222
auto-config: false
2323
use-github-cache: false

0 commit comments

Comments
 (0)