@@ -247,76 +247,6 @@ jobs:
247247 echo "✅ All inputRevs in lake-manifest.json are valid"
248248 fi
249249
250- - name : validate ProofWidgets source repository
251- # Only enforce this on the main mathlib4 repository, not on nightly-testing
252- if : github.repository == 'leanprover-community/mathlib4'
253- shell : bash
254- run : |
255- cd pr-branch
256-
257- expected_url='https://github.com/leanprover-community/ProofWidgets4'
258- proofwidgets_count=$(jq '[.packages[] | select(.name == "proofwidgets")] | length' lake-manifest.json)
259- if [ "$proofwidgets_count" -ne 1 ]; then
260- echo "❌ Error: expected exactly one proofwidgets entry in lake-manifest.json, found $proofwidgets_count"
261- exit 1
262- fi
263-
264- proofwidgets_url=$(jq -r '.packages[] | select(.name == "proofwidgets") | .url' lake-manifest.json)
265- normalized_url="${proofwidgets_url%.git}"
266- if [ "$normalized_url" != "$expected_url" ]; then
267- echo "❌ Error: invalid ProofWidgets source URL in lake-manifest.json"
268- echo " expected: $expected_url"
269- echo " found: $proofwidgets_url"
270- exit 1
271- fi
272-
273- echo "✅ ProofWidgets source URL is allowed: $proofwidgets_url"
274-
275- - name : verify ProofWidgets lean-toolchain matches on versioned releases
276- # Only enforce this on the main mathlib4 repository, not on nightly-testing
277- if : github.repository == 'leanprover-community/mathlib4'
278- shell : bash
279- run : |
280- cd pr-branch
281-
282- # Read the lean-toolchain file
283- TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]')
284- echo "Lean toolchain: $TOOLCHAIN"
285-
286- # Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1)
287- if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
288- echo "✓ Detected versioned Lean release: $TOOLCHAIN"
289- echo "Verifying ProofWidgets lean-toolchain matches..."
290-
291- # Check if ProofWidgets lean-toolchain exists
292- if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then
293- echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist"
294- echo "This file should be created by 'lake env' during dependency download."
295- exit 1
296- fi
297-
298- # Read ProofWidgets lean-toolchain
299- PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]')
300- echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN"
301-
302- # Compare the two
303- if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then
304- echo "❌ Error: Lean toolchain mismatch!"
305- echo " Main lean-toolchain: $TOOLCHAIN"
306- echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN"
307- echo ""
308- echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z),"
309- echo "the ProofWidgets dependency must use the same toolchain."
310- echo "Please update the ProofWidgets dependency to use $TOOLCHAIN"
311- exit 1
312- else
313- echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN"
314- fi
315- else
316- echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)"
317- echo "Skipping ProofWidgets toolchain verification."
318- fi
319-
320250 - name : get cache (1/3 - setup and initial fetch)
321251 id : get_cache_part1_setup
322252 shell : bash # only runs `cache get` from `tools-branch`, so doesn't need to be inside landrun
@@ -327,7 +257,7 @@ jobs:
327257
328258 # Fail quickly if the cache is completely cold, by checking for Mathlib.Init
329259 echo "Attempting to fetch olean for Mathlib/Init.lean from cache..."
330- ../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Mathlib/Init.lean
260+ ../tools-branch/.lake/build/bin/cache get Mathlib/Init.lean
331261
332262 - name : get cache (2/3 - test Mathlib.Init cache)
333263 id : get_cache_part2_test
@@ -380,13 +310,19 @@ jobs:
380310 # cf. https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Mathlib.20has.20moved.20to.20the.20new.20module.20system/near/563452000
381311 echo "Warming up cache using previous commit: $PREV_SHA (source: $PREV_SHA_SOURCE)"
382312 if git cat-file -e "$PREV_SHA^{commit}" 2>/dev/null || git fetch --no-tags --depth=1 origin "$PREV_SHA"; then
383- git checkout "$PREV_SHA"
384- ../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
385- # Run again with --repo, to ensure we actually get the oleans.
386- ../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
387-
388- echo "Switching back to branch head"
389- git checkout "$ORIG_SHA"
313+ # Skip warmup if the previous commit uses a different toolchain
314+ PREV_TOOLCHAIN=$(git show "$PREV_SHA:lean-toolchain" 2>/dev/null || true)
315+ if [[ "$PREV_TOOLCHAIN" != "$(cat lean-toolchain)" ]]; then
316+ echo "Previous commit $PREV_SHA uses a different toolchain ($PREV_TOOLCHAIN); skipping warmup."
317+ else
318+ git checkout "$PREV_SHA"
319+ ../tools-branch/.lake/build/bin/cache get
320+ # Run again with --repo, to ensure we actually get the oleans.
321+ ../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" get
322+
323+ echo "Switching back to branch head"
324+ git checkout "$ORIG_SHA"
325+ fi
390326 else
391327 echo "Could not fetch $PREV_SHA; skipping parent warmup cache fetch."
392328 fi
@@ -396,18 +332,10 @@ jobs:
396332
397333 echo "Fetching all remaining cache..."
398334
399- ../tools-branch/.lake/build/bin/cache --skip-proofwidgets get
335+ ../tools-branch/.lake/build/bin/cache get
400336
401337 # Run again with --repo, to ensure we actually get the oleans.
402- ../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" --skip-proofwidgets get
403-
404- - name : fetch ProofWidgets release
405- # We need network access for ProofWidgets frontend assets.
406- # Run inside landrun so PR-controlled code remains sandboxed.
407- shell : landrun --unrestricted-network --rox /etc --rox /usr --rw /dev --rox /home/lean/.elan --rox /home/lean/actions-runner/_work --rw pr-branch/.lake/ --env PATH --env HOME --env GITHUB_OUTPUT --env CI -- bash -euxo pipefail {0}
408- run : |
409- cd pr-branch
410- lake build proofwidgets:release
338+ ../tools-branch/.lake/build/bin/cache --repo="$CACHE_REPO" get
411339
412340 - name : update {Mathlib, Tactic, Counterexamples, Archive}.lean
413341 id : mk_all
@@ -462,8 +390,8 @@ jobs:
462390 shell : bash
463391 run : |
464392 cd pr-branch
465- ../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Archive.lean
466- ../tools-branch/.lake/build/bin/cache --skip-proofwidgets get Counterexamples.lean
393+ ../tools-branch/.lake/build/bin/cache get Archive.lean
394+ ../tools-branch/.lake/build/bin/cache get Counterexamples.lean
467395
468396 - name : build archive
469397 id : archive
@@ -646,7 +574,7 @@ jobs:
646574 - name : Generate lean-pr-testing app token
647575 if : ${{ always() && github.repository == 'leanprover-community/mathlib4-nightly-testing' && (startsWith(github.ref_name, 'lean-pr-testing-') || startsWith(github.ref_name, 'batteries-pr-testing-')) }}
648576 id : lean-pr-testing-token
649- uses : actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
577+ uses : actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
650578 with :
651579 app-id : ${{ secrets.MATHLIB_LEAN_PR_TESTING_APP_ID }}
652580 private-key : ${{ secrets.MATHLIB_LEAN_PR_TESTING_PRIVATE_KEY }}
@@ -708,7 +636,7 @@ jobs:
708636 echo "CACHE_BIN=$CACHE_BIN" >> "$GITHUB_ENV"
709637
710638 - name : Download cache staging artifact
711- uses : actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
639+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
712640 with :
713641 name : cache-staging
714642 path : cache-staging
@@ -815,6 +743,12 @@ jobs:
815743 - name : clean up the import graph file
816744 run : rm import_graph.dot
817745
746+ - name : check all scripts build successfully
747+ run : |
748+ lake env lean scripts/create_deprecated_modules.lean
749+ lake env lean scripts/autolabel.lean
750+ lake exe check_title_labels --labels "t-algebra" "feat: dummy PR for testing"
751+
818752 - name : build everything
819753 # make sure everything is available for test/import_all.lean
820754 # and that miscellaneous executables still work
@@ -937,7 +871,8 @@ jobs:
937871 - if : >- # bot usernames will cause this step to error with "Could not resolve to a User..."
938872 contains(steps.PR.outputs.pr_labels, 'auto-merge-after-CI') &&
939873 steps.get-label-actor.outputs.username != 'mathlib-nolints' &&
940- steps.get-label-actor.outputs.username != 'mathlib-update-dependencies'
874+ steps.get-label-actor.outputs.username != 'mathlib-update-dependencies' &&
875+ steps.get-label-actor.outputs.username != 'mathlib-splicebot'
941876 name: check team membership
942877 uses: tspascoal/get-user-teams-membership@57e9f42acd78f4d0f496b3be4368fc5f62696662 # v3.0.0
943878 id: actorTeams
@@ -952,7 +887,9 @@ jobs:
952887 (
953888 steps.get-label-actor.outputs.username == 'mathlib-nolints' ||
954889 steps.get-label-actor.outputs.username == 'mathlib-update-dependencies' ||
890+ steps.get-label-actor.outputs.username == 'mathlib-splicebot' ||
955891 contains(steps.actorTeams.outputs.teams, 'mathlib-maintainers') ||
892+ contains(steps.actorTeams.outputs.teams, 'lean-release-managers') ||
956893 contains(steps.actorTeams.outputs.teams, 'bot-users')
957894 )
958895 name: If `auto-merge-after-CI` is present, add a `bors merge` comment.
0 commit comments