Skip to content

Commit d859d58

Browse files
committed
Merge branch 'master' into fae_PR_TrueRankOne
2 parents 6397c09 + 9209df7 commit d859d58

2,907 files changed

Lines changed: 72121 additions & 32759 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: 12 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ jobs:
133133
shell: bash
134134
run: |
135135
# Construct the LEAN_SRC_PATH using the toolchain directory
136-
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake:.lake/packages/Cli:.lake/packages/batteries:.lake/packages/Qq:.lake/packages/aesop:.lake/packages/proofwidgets:.lake/packages/importGraph:.lake/packages/LeanSearchClient:.lake/packages/plausible"
136+
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake:.lake/packages/Cli:.lake/packages/batteries:.lake/packages/Qq:.lake/packages/aesop:.lake/packages/proofwidgets:.lake/packages/importGraph:.lake/packages/LeanSearchClient:.lake/packages/plausible:.lake/packages/requests:.lake/packages/openAI_client:.lake/packages/reap"
137137
echo "LEAN_SRC_PATH=$LEAN_SRC_PATH"
138138
139139
# Set it as an environment variable for subsequent steps
@@ -328,37 +328,6 @@ jobs:
328328
env:
329329
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
330330

331-
# The cache secrets are available here, so we must not run any untrusted code.
332-
- name: Upload cache to Cloudflare
333-
id: cloudflare-upload-mathlib
334-
if: ${{ always() && steps.get.outcome == 'success' }}
335-
continue-on-error: true
336-
shell: bash
337-
run: |
338-
cd pr-branch
339-
340-
# Trim trailing whitespace from secrets to prevent issues with accidentally added spaces
341-
export MATHLIB_CACHE_S3_TOKEN="${MATHLIB_CACHE_S3_TOKEN_RAW%"${MATHLIB_CACHE_S3_TOKEN_RAW##*[![:space:]]}"}"
342-
343-
echo "Uploading cache to Cloudflare..."
344-
USE_FRO_CACHE=1 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put-unpacked
345-
env:
346-
MATHLIB_CACHE_S3_TOKEN_RAW: ${{ secrets.MATHLIB_CACHE_S3_TOKEN }}
347-
348-
- name: Report Cloudflare upload failure on Zulip
349-
if: steps.cloudflare-upload-mathlib.outcome == 'failure'
350-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
351-
with:
352-
api-key: ${{ secrets.ZULIP_API_KEY }}
353-
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
354-
organization-url: 'https://leanprover.zulipchat.com'
355-
to: 'nightly-testing'
356-
type: 'stream'
357-
topic: 'Cloudflare cache upload failure'
358-
content: |
359-
❌ Cloudflare cache upload (Mathlib) [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for PR #${{ github.event.pull_request.number || 'push' }} on commit ${{ github.sha }}
360-
continue-on-error: true
361-
362331
# Note: we should not be including `Archive` and `Counterexamples` in the cache.
363332
# We do this for now for the sake of not rebuilding them in every CI run
364333
# even when they are not touched.
@@ -409,41 +378,11 @@ jobs:
409378
export MATHLIB_CACHE_SAS="${MATHLIB_CACHE_SAS_RAW%"${MATHLIB_CACHE_SAS_RAW##*[![:space:]]}"}"
410379
411380
echo "Uploading Archive and Counterexamples cache to Azure..."
412-
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Archive.lean
413-
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Counterexamples.lean
381+
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put-unpacked Archive.lean
382+
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put-unpacked Counterexamples.lean
414383
env:
415384
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
416385

417-
- name: Upload Archive and Counterexamples cache to Cloudflare
418-
id: cloudflare-upload-archive
419-
continue-on-error: true
420-
shell: bash
421-
run: |
422-
cd pr-branch
423-
424-
# Trim trailing whitespace from secrets to prevent issues with accidentally added spaces
425-
export MATHLIB_CACHE_S3_TOKEN="${MATHLIB_CACHE_S3_TOKEN_RAW%"${MATHLIB_CACHE_S3_TOKEN_RAW##*[![:space:]]}"}"
426-
427-
echo "Uploading Archive and Counterexamples cache to Cloudflare..."
428-
USE_FRO_CACHE=1 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Archive.lean
429-
USE_FRO_CACHE=1 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Counterexamples.lean
430-
env:
431-
MATHLIB_CACHE_S3_TOKEN_RAW: ${{ secrets.MATHLIB_CACHE_S3_TOKEN }}
432-
433-
- name: Report Cloudflare Archive/Counterexamples upload failure on Zulip
434-
if: steps.cloudflare-upload-archive.outcome == 'failure'
435-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
436-
with:
437-
api-key: ${{ secrets.ZULIP_API_KEY }}
438-
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
439-
organization-url: 'https://leanprover.zulipchat.com'
440-
to: 'nightly-testing'
441-
type: 'stream'
442-
topic: 'Cloudflare cache upload failure'
443-
content: |
444-
❌ Cloudflare cache upload (Archive/Counterexamples) [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for PR #${{ github.event.pull_request.number || 'push' }} on commit ${{ github.sha }}
445-
continue-on-error: true
446-
447386
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
448387
if: always()
449388
run: |
@@ -550,29 +489,6 @@ jobs:
550489
use-mathlib-cache: false # This can be re-enabled once we are confident in the cache again.
551490
reinstall-transient-toolchain: true
552491

553-
- name: retrieve and test the Cloudflare caches, but don't fail, just report to Zulip, if anything goes wrong
554-
id: cloudflare-cache
555-
continue-on-error: true
556-
run: |
557-
lake exe cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} get
558-
lake build --no-build -v Mathlib
559-
lake exe cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} get Archive Counterexamples
560-
lake build --no-build -v Archive Counterexamples
561-
562-
- name: Report Cloudflare cache failure on Zulip
563-
if: steps.cloudflare-cache.outcome == 'failure'
564-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
565-
with:
566-
api-key: ${{ secrets.ZULIP_API_KEY }}
567-
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
568-
organization-url: 'https://leanprover.zulipchat.com'
569-
to: 'nightly-testing'
570-
type: 'stream'
571-
topic: 'Cloudflare cache failure'
572-
content: |
573-
❌ Cloudflare cache retrieval/test [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for PR #${{ github.event.pull_request.number || 'push' }} on commit ${{ github.sha }}
574-
continue-on-error: true
575-
576492
- name: get cache for Mathlib
577493
run: |
578494
# Run once without --repo, so we can diagnose what `lake exe cache get` wants to do by itself.
@@ -590,13 +506,13 @@ jobs:
590506
- name: verify that everything was available in the cache
591507
run: |
592508
echo "::group::{verify Mathlib cache}"
593-
lake build --no-build -v Mathlib
509+
lake build --no-build --rehash -v Mathlib
594510
echo "::endgroup::"
595511
echo "::group::{verify Archive cache}"
596-
lake build --no-build -v Archive
512+
lake build --no-build --rehash -v Archive
597513
echo "::endgroup::"
598514
echo "::group::{verify Counterexamples cache}"
599-
lake build --no-build -v Counterexamples
515+
lake build --no-build --rehash -v Counterexamples
600516
echo "::endgroup::"
601517
602518
- name: check declarations in db files
@@ -625,6 +541,12 @@ jobs:
625541
run: |
626542
lake build Batteries Qq Aesop ProofWidgets Plausible
627543
544+
- name: build AesopTest (nightly-testing only)
545+
# Only run on the mathlib4-nightly-testing repository
546+
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
547+
run: |
548+
lake build AesopTest
549+
628550
# We no longer run `lean4checker` in regular CI, as it is quite expensive for little benefit.
629551
# Instead we run it in a cron job on master: see `lean4checker.yml`.
630552
# Output is posted to the zulip topic
@@ -665,16 +587,6 @@ jobs:
665587
lint-bib-file: true
666588
ref: ${{ PR_BRANCH_REF }}
667589

668-
build_and_lint:
669-
name: CI Success
670-
if: FORK_CONDITION
671-
needs: [style_lint, post_steps]
672-
runs-on: ubuntu-latest
673-
steps:
674-
- name: succeed
675-
run: |
676-
echo "Success: Required build and lint checks completed!"
677-
678590
final:
679591
name: Post-CI jobJOB_NAME
680592
if: FORK_CONDITION

.github/workflows/bors.yml

Lines changed: 12 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
shell: bash
144144
run: |
145145
# Construct the LEAN_SRC_PATH using the toolchain directory
146-
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake:.lake/packages/Cli:.lake/packages/batteries:.lake/packages/Qq:.lake/packages/aesop:.lake/packages/proofwidgets:.lake/packages/importGraph:.lake/packages/LeanSearchClient:.lake/packages/plausible"
146+
LEAN_SRC_PATH=".:$TOOLCHAIN_DIR/src/lean/lake:.lake/packages/Cli:.lake/packages/batteries:.lake/packages/Qq:.lake/packages/aesop:.lake/packages/proofwidgets:.lake/packages/importGraph:.lake/packages/LeanSearchClient:.lake/packages/plausible:.lake/packages/requests:.lake/packages/openAI_client:.lake/packages/reap"
147147
echo "LEAN_SRC_PATH=$LEAN_SRC_PATH"
148148
149149
# Set it as an environment variable for subsequent steps
@@ -338,37 +338,6 @@ jobs:
338338
env:
339339
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
340340

341-
# The cache secrets are available here, so we must not run any untrusted code.
342-
- name: Upload cache to Cloudflare
343-
id: cloudflare-upload-mathlib
344-
if: ${{ always() && steps.get.outcome == 'success' }}
345-
continue-on-error: true
346-
shell: bash
347-
run: |
348-
cd pr-branch
349-
350-
# Trim trailing whitespace from secrets to prevent issues with accidentally added spaces
351-
export MATHLIB_CACHE_S3_TOKEN="${MATHLIB_CACHE_S3_TOKEN_RAW%"${MATHLIB_CACHE_S3_TOKEN_RAW##*[![:space:]]}"}"
352-
353-
echo "Uploading cache to Cloudflare..."
354-
USE_FRO_CACHE=1 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put-unpacked
355-
env:
356-
MATHLIB_CACHE_S3_TOKEN_RAW: ${{ secrets.MATHLIB_CACHE_S3_TOKEN }}
357-
358-
- name: Report Cloudflare upload failure on Zulip
359-
if: steps.cloudflare-upload-mathlib.outcome == 'failure'
360-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
361-
with:
362-
api-key: ${{ secrets.ZULIP_API_KEY }}
363-
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
364-
organization-url: 'https://leanprover.zulipchat.com'
365-
to: 'nightly-testing'
366-
type: 'stream'
367-
topic: 'Cloudflare cache upload failure'
368-
content: |
369-
❌ Cloudflare cache upload (Mathlib) [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for PR #${{ github.event.pull_request.number || 'push' }} on commit ${{ github.sha }}
370-
continue-on-error: true
371-
372341
# Note: we should not be including `Archive` and `Counterexamples` in the cache.
373342
# We do this for now for the sake of not rebuilding them in every CI run
374343
# even when they are not touched.
@@ -419,41 +388,11 @@ jobs:
419388
export MATHLIB_CACHE_SAS="${MATHLIB_CACHE_SAS_RAW%"${MATHLIB_CACHE_SAS_RAW##*[![:space:]]}"}"
420389
421390
echo "Uploading Archive and Counterexamples cache to Azure..."
422-
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Archive.lean
423-
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Counterexamples.lean
391+
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put-unpacked Archive.lean
392+
USE_FRO_CACHE=0 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put-unpacked Counterexamples.lean
424393
env:
425394
MATHLIB_CACHE_SAS_RAW: ${{ secrets.MATHLIB_CACHE_SAS }}
426395

427-
- name: Upload Archive and Counterexamples cache to Cloudflare
428-
id: cloudflare-upload-archive
429-
continue-on-error: true
430-
shell: bash
431-
run: |
432-
cd pr-branch
433-
434-
# Trim trailing whitespace from secrets to prevent issues with accidentally added spaces
435-
export MATHLIB_CACHE_S3_TOKEN="${MATHLIB_CACHE_S3_TOKEN_RAW%"${MATHLIB_CACHE_S3_TOKEN_RAW##*[![:space:]]}"}"
436-
437-
echo "Uploading Archive and Counterexamples cache to Cloudflare..."
438-
USE_FRO_CACHE=1 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Archive.lean
439-
USE_FRO_CACHE=1 ../master-branch/.lake/build/bin/cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} put Counterexamples.lean
440-
env:
441-
MATHLIB_CACHE_S3_TOKEN_RAW: ${{ secrets.MATHLIB_CACHE_S3_TOKEN }}
442-
443-
- name: Report Cloudflare Archive/Counterexamples upload failure on Zulip
444-
if: steps.cloudflare-upload-archive.outcome == 'failure'
445-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
446-
with:
447-
api-key: ${{ secrets.ZULIP_API_KEY }}
448-
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
449-
organization-url: 'https://leanprover.zulipchat.com'
450-
to: 'nightly-testing'
451-
type: 'stream'
452-
topic: 'Cloudflare cache upload failure'
453-
content: |
454-
❌ Cloudflare cache upload (Archive/Counterexamples) [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for PR #${{ github.event.pull_request.number || 'push' }} on commit ${{ github.sha }}
455-
continue-on-error: true
456-
457396
- name: Check {Mathlib, Tactic, Counterexamples, Archive}.lean
458397
if: always()
459398
run: |
@@ -560,29 +499,6 @@ jobs:
560499
use-mathlib-cache: false # This can be re-enabled once we are confident in the cache again.
561500
reinstall-transient-toolchain: true
562501

563-
- name: retrieve and test the Cloudflare caches, but don't fail, just report to Zulip, if anything goes wrong
564-
id: cloudflare-cache
565-
continue-on-error: true
566-
run: |
567-
lake exe cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} get
568-
lake build --no-build -v Mathlib
569-
lake exe cache --repo=${{ github.event.pull_request.head.repo.full_name || github.repository }} get Archive Counterexamples
570-
lake build --no-build -v Archive Counterexamples
571-
572-
- name: Report Cloudflare cache failure on Zulip
573-
if: steps.cloudflare-cache.outcome == 'failure'
574-
uses: zulip/github-actions-zulip/send-message@e4c8f27c732ba9bd98ac6be0583096dea82feea5 # v1.0.2
575-
with:
576-
api-key: ${{ secrets.ZULIP_API_KEY }}
577-
email: 'github-mathlib4-bot@leanprover.zulipchat.com'
578-
organization-url: 'https://leanprover.zulipchat.com'
579-
to: 'nightly-testing'
580-
type: 'stream'
581-
topic: 'Cloudflare cache failure'
582-
content: |
583-
❌ Cloudflare cache retrieval/test [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) for PR #${{ github.event.pull_request.number || 'push' }} on commit ${{ github.sha }}
584-
continue-on-error: true
585-
586502
- name: get cache for Mathlib
587503
run: |
588504
# Run once without --repo, so we can diagnose what `lake exe cache get` wants to do by itself.
@@ -600,13 +516,13 @@ jobs:
600516
- name: verify that everything was available in the cache
601517
run: |
602518
echo "::group::{verify Mathlib cache}"
603-
lake build --no-build -v Mathlib
519+
lake build --no-build --rehash -v Mathlib
604520
echo "::endgroup::"
605521
echo "::group::{verify Archive cache}"
606-
lake build --no-build -v Archive
522+
lake build --no-build --rehash -v Archive
607523
echo "::endgroup::"
608524
echo "::group::{verify Counterexamples cache}"
609-
lake build --no-build -v Counterexamples
525+
lake build --no-build --rehash -v Counterexamples
610526
echo "::endgroup::"
611527
612528
- name: check declarations in db files
@@ -635,6 +551,12 @@ jobs:
635551
run: |
636552
lake build Batteries Qq Aesop ProofWidgets Plausible
637553
554+
- name: build AesopTest (nightly-testing only)
555+
# Only run on the mathlib4-nightly-testing repository
556+
if: github.repository == 'leanprover-community/mathlib4-nightly-testing'
557+
run: |
558+
lake build AesopTest
559+
638560
# We no longer run `lean4checker` in regular CI, as it is quite expensive for little benefit.
639561
# Instead we run it in a cron job on master: see `lean4checker.yml`.
640562
# Output is posted to the zulip topic
@@ -675,16 +597,6 @@ jobs:
675597
lint-bib-file: true
676598
ref: ${{ github.sha }}
677599

678-
build_and_lint:
679-
name: CI Success
680-
if: github.repository == 'leanprover-community/mathlib4' || github.repository == 'leanprover-community/mathlib4-nightly-testing'
681-
needs: [style_lint, post_steps]
682-
runs-on: ubuntu-latest
683-
steps:
684-
- name: succeed
685-
run: |
686-
echo "Success: Required build and lint checks completed!"
687-
688600
final:
689601
name: Post-CI job
690602
if: github.repository == 'leanprover-community/mathlib4' || github.repository == 'leanprover-community/mathlib4-nightly-testing'

0 commit comments

Comments
 (0)