|
14 | 14 | - 'staging.tmp*' |
15 | 15 | - 'trying.tmp*' |
16 | 16 | - 'staging*.tmp' |
17 | | - - 'nolints' |
18 | 17 | # ignore staging branch used by bors, this is handled by bors.yml |
19 | 18 | - 'staging' |
20 | 19 | merge_group: |
|
55 | 54 | lint-outcome: ${{ steps.lint.outcome }} |
56 | 55 | mk_all-outcome: ${{ steps.mk_all.outcome }} |
57 | 56 | noisy-outcome: ${{ steps.noisy.outcome }} |
58 | | - shake-outcome: ${{ steps.shake.outcome }} |
| 57 | + # shake-outcome: ${{ steps.shake.outcome }} |
59 | 58 | test-outcome: ${{ steps.test.outcome }} |
60 | 59 | defaults: # On Hoskinson runners, landrun is already installed. |
61 | 60 | run: # note that .pr-branch/.lake must be created in a step below before we use this |
@@ -255,6 +254,51 @@ jobs: |
255 | 254 | echo "✅ All inputRevs in lake-manifest.json are valid" |
256 | 255 | fi |
257 | 256 |
|
| 257 | + - name: verify ProofWidgets lean-toolchain matches on versioned releases |
| 258 | + # Only enforce this on the main mathlib4 repository, not on nightly-testing |
| 259 | + if: github.repository == 'leanprover-community/mathlib4' |
| 260 | + shell: bash |
| 261 | + run: | |
| 262 | + cd pr-branch |
| 263 | +
|
| 264 | + # Read the lean-toolchain file |
| 265 | + TOOLCHAIN=$(cat lean-toolchain | tr -d '[:space:]') |
| 266 | + echo "Lean toolchain: $TOOLCHAIN" |
| 267 | +
|
| 268 | + # Check if toolchain matches the versioned release pattern: leanprover/lean4:vX.Y.Z (with optional suffix like -rc1) |
| 269 | + if [[ "$TOOLCHAIN" =~ ^leanprover/lean4:v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then |
| 270 | + echo "✓ Detected versioned Lean release: $TOOLCHAIN" |
| 271 | + echo "Verifying ProofWidgets lean-toolchain matches..." |
| 272 | +
|
| 273 | + # Check if ProofWidgets lean-toolchain exists |
| 274 | + if [ ! -f .lake/packages/proofwidgets/lean-toolchain ]; then |
| 275 | + echo "❌ Error: .lake/packages/proofwidgets/lean-toolchain does not exist" |
| 276 | + echo "This file should be created by 'lake env' during dependency download." |
| 277 | + exit 1 |
| 278 | + fi |
| 279 | +
|
| 280 | + # Read ProofWidgets lean-toolchain |
| 281 | + PROOFWIDGETS_TOOLCHAIN=$(cat .lake/packages/proofwidgets/lean-toolchain | tr -d '[:space:]') |
| 282 | + echo "ProofWidgets toolchain: $PROOFWIDGETS_TOOLCHAIN" |
| 283 | +
|
| 284 | + # Compare the two |
| 285 | + if [ "$TOOLCHAIN" != "$PROOFWIDGETS_TOOLCHAIN" ]; then |
| 286 | + echo "❌ Error: Lean toolchain mismatch!" |
| 287 | + echo " Main lean-toolchain: $TOOLCHAIN" |
| 288 | + echo " ProofWidgets lean-toolchain: $PROOFWIDGETS_TOOLCHAIN" |
| 289 | + echo "" |
| 290 | + echo "When using a versioned Lean release (leanprover/lean4:vX.Y.Z)," |
| 291 | + echo "the ProofWidgets dependency must use the same toolchain." |
| 292 | + echo "Please update the ProofWidgets dependency to use $TOOLCHAIN" |
| 293 | + exit 1 |
| 294 | + else |
| 295 | + echo "✅ ProofWidgets lean-toolchain matches: $TOOLCHAIN" |
| 296 | + fi |
| 297 | + else |
| 298 | + echo "ℹ Lean toolchain is not a versioned release (pattern: leanprover/lean4:vX.Y.Z)" |
| 299 | + echo "Skipping ProofWidgets toolchain verification." |
| 300 | + fi |
| 301 | +
|
258 | 302 | - name: get cache (1/3 - setup and initial fetch) |
259 | 303 | id: get_cache_part1_setup |
260 | 304 | shell: bash # only runs `cache get` from `master-branch`, so doesn't need to be inside landrun |
@@ -429,7 +473,7 @@ jobs: |
429 | 473 | MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }} |
430 | 474 |
|
431 | 475 | - name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean |
432 | | - if: always() |
| 476 | + if: ${{ always() && steps.mk_all.outcome != 'skipped' }} |
433 | 477 | run: | |
434 | 478 | if [[ "${{ steps.mk_all.outcome }}" != "success" ]]; then |
435 | 479 | echo "Please run 'lake exe mk_all' to regenerate the import all files" |
@@ -460,11 +504,13 @@ jobs: |
460 | 504 | action: add # In order to be able to run a multiline script, we need to add/remove the problem matcher before and after. |
461 | 505 | linters: gcc |
462 | 506 |
|
463 | | - - name: check for unused imports |
464 | | - id: shake |
465 | | - run: | |
466 | | - cd pr-branch |
467 | | - env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style |
| 507 | + # With the arrival of the module system, the old `shake` is no longer functional. |
| 508 | + # This will be replaced soon. |
| 509 | + # - name: check for unused imports |
| 510 | + # id: shake |
| 511 | + # run: | |
| 512 | + # cd pr-branch |
| 513 | + # env LEAN_ABORT_ON_PANIC=1 lake exe shake --gh-style |
468 | 514 |
|
469 | 515 | - name: lint mathlib |
470 | 516 | if: ${{ always() && steps.build.outcome == 'success' || steps.build.outcome == 'failure' }} |
|
0 commit comments