Skip to content

Commit 3a340c2

Browse files
authored
Merge branch 'leanprover-community:master' into main
2 parents 35fc51a + 3b5ca69 commit 3a340c2

4,277 files changed

Lines changed: 94116 additions & 60647 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: 152 additions & 27 deletions
Large diffs are not rendered by default.

.github/workflows/PR_summary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
git diff --name-only --diff-filter D origin/${{ github.base_ref }}... | tee removed_files.txt
8787
echo "Checking for renamed files..."
8888
89-
# Shows the `R`enamed files, in human readable format
89+
# Shows the `R`enamed files, in human-readable format
9090
# The `awk` pipe
9191
# * extracts into an array the old name as the key and the new name as the value
9292
# * eventually prints "`oldName` was renamed to `newName`" for each key-value pair.

.github/workflows/bors.yml

Lines changed: 157 additions & 32 deletions
Large diffs are not rendered by default.

.github/workflows/bot_fix_style.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
# && (startsWith(github.event.comment.body, 'bot fix style') || contains(toJSON(github.event.comment.body), '\nbot fix style'))
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: leanprover-community/lint-style-action@f2e7272aad56233a642b08fe974cf09dd664b0c8 # 2025-05-22
30+
- uses: leanprover-community/lint-style-action@a7e7428fa44f9635d6eb8e01919d16fd498d387a # 2025-08-18
3131
with:
3232
mode: fix
3333
lint-bib-file: true

.github/workflows/build.yml

Lines changed: 152 additions & 27 deletions
Large diffs are not rendered by default.

.github/workflows/build_fork.yml

Lines changed: 152 additions & 27 deletions
Large diffs are not rendered by default.

.github/workflows/daily.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ jobs:
4242
- name: Fetch latest tags (if nightly)
4343
if: matrix.branch_type == 'nightly'
4444
run: |
45-
git fetch --tags
45+
# When in nightly mode, fetch tags from the nightly-testing repository
46+
git remote add nightly-testing https://github.com/leanprover-community/mathlib4-nightly-testing.git
47+
git fetch nightly-testing --tags
4648
LATEST_TAG=$(git tag | grep -E "${{ env.TAG_PATTERN }}" | sort -r | head -n 1)
4749
echo "LATEST_TAG=${LATEST_TAG}" >> "$GITHUB_ENV"
4850
@@ -58,6 +60,7 @@ jobs:
5860
- name: Checkout branch or tag
5961
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6062
with:
63+
repository: ${{ matrix.branch_type == 'nightly' && 'leanprover-community/mathlib4-nightly-testing' || github.repository }}
6164
ref: ${{ env.BRANCH_REF }}
6265

6366
- name: Configure Lean

.github/workflows/discover-lean-pr-testing.yml

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,39 @@ jobs:
7171
# Fetch the $OLD tag
7272
git fetch --depth=1 origin tag "$OLD" --no-tags
7373
# Fetch the $NEW tag.
74-
# This will only fetch commits newer than previously fetched commits (ie $OLD)
74+
# This will only fetch commits newer than previously fetched commits (i.e. $OLD)
7575
git fetch origin tag "$NEW" --no-tags
7676
77-
# Find all commits to lean4 between the $OLD and $NEW toolchains
78-
# and extract the github PR numbers
79-
# (drop anything that doesn't look like a PR number from the final result)
80-
PRS=$(git log --oneline "$OLD..$NEW" | sed 's/.*(#\([0-9]\+\))$/\1/' | grep -E '^[0-9]+$')
77+
# Get all commit SHAs between the $OLD and $NEW toolchains
78+
COMMIT_SHAS=$(git log --format="%H" "$OLD..$NEW")
79+
80+
# Initialize an empty string to collect PR numbers
81+
PRS=""
82+
83+
# For each commit, query the GitHub API to get associated PRs
84+
for commit_sha in $COMMIT_SHAS; do
85+
echo "Checking commit $commit_sha for associated PRs..."
86+
87+
# Query GitHub API for PRs associated with this commit
88+
# Using jq to extract PR numbers from the response
89+
pr_numbers=$(curl -s -H "Accept: application/vnd.github.v3+json" \
90+
"https://api.github.com/repos/leanprover/lean4/commits/$commit_sha/pulls" | \
91+
jq -r '.[] | select(.merged_at != null) | .number | tostring' 2>/dev/null || echo "")
92+
93+
# Add each PR number to our list (duplicates will be handled later)
94+
for pr_num in $pr_numbers; do
95+
if [[ "$pr_num" =~ ^[0-9]+$ ]]; then
96+
PRS="$PRS $pr_num"
97+
echo "Found PR #$pr_num associated with commit $commit_sha"
98+
fi
99+
done
100+
done
101+
102+
# Remove duplicates and trim whitespace
103+
PRS=$(echo "$PRS" | tr ' ' '\n' | sort -u | tr '\n' ' ' | xargs)
81104
82105
# Output the PRs
83-
echo "$PRS"
106+
echo "Found PRs: $PRS"
84107
printf "prs<<EOF\n%s\nEOF" "$PRS" >> "$GITHUB_OUTPUT"
85108
86109
- name: Use merged PRs information

.github/workflows/lint_and_suggest_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
name: Lint style
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: leanprover-community/lint-style-action@f2e7272aad56233a642b08fe974cf09dd664b0c8 # 2025-05-22
12+
- uses: leanprover-community/lint-style-action@a7e7428fa44f9635d6eb8e01919d16fd498d387a # 2025-08-18
1313
with:
1414
mode: suggest
1515
lint-bib-file: true

.github/workflows/maintainer_bors.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
COMMENT_EVENT: ${{ github.event.comment.body }}
2323
COMMENT_REVIEW: ${{ github.event.review.body }}
2424
PR_NUMBER: ${{ github.event.issue.number }}${{ github.event.pull_request.number }}
25+
HAS_DELEGATED_LABEL: ${{ contains(github.event.issue.labels.*.name, 'delegated') }}
2526
name: Add ready-to-merge or delegated label
2627
runs-on: ubuntu-latest
2728
if: github.repository == 'leanprover-community/mathlib4'
@@ -35,8 +36,14 @@ jobs:
3536
# for debugging, we print some information
3637
printf '%s' "${COMMENT}" | hexdump -cC
3738
printf 'Comment:"%s"\n' "${COMMENT}"
38-
m_or_d="$(printf '%s' "${COMMENT}" |
39-
sed -n 's=^bors *\(merge\|r+\) *$=ready-to-merge=p; s=^bors *\(delegate\|d+\|d\=\).*=delegated=p' | head -1)"
39+
if [ "${AUTHOR}" == 'mathlib-bors[bot]' ] && [ "${HAS_DELEGATED_LABEL}" == 'true' ]
40+
then
41+
m_or_d="$(printf '%s' "${COMMENT}" |
42+
sed -n 's=^Build failed:=delegated=p' | head -1)"
43+
else
44+
m_or_d="$(printf '%s' "${COMMENT}" |
45+
sed -n 's=^bors *\(merge\|r+\) *$=ready-to-merge=p; s=^bors *\(delegate\|d+\|d\=\).*=delegated=p' | head -1)"
46+
fi
4047
4148
remove_labels="$(printf '%s' "${COMMENT}" |
4249
sed -n 's=^bors *\(merge\|r\|d\)- *$=remove-labels=p' | head -1)"
@@ -50,7 +57,8 @@ jobs:
5057
printf $'mOrD=%s\n' "${m_or_d}" >> "${GITHUB_OUTPUT}"
5158
printf $'removeLabels=%s\n' "${remove_labels}" >> "${GITHUB_OUTPUT}"
5259
if [ "${AUTHOR}" == 'leanprover-community-mathlib4-bot' ] ||
53-
[ "${AUTHOR}" == 'leanprover-community-bot-assistant' ]
60+
[ "${AUTHOR}" == 'leanprover-community-bot-assistant' ] ||
61+
[ "${AUTHOR}" == 'mathlib-bors[bot]' ]
5462
then
5563
printf $'bot=true\n'
5664
printf $'bot=true\n' >> "${GITHUB_OUTPUT}"

0 commit comments

Comments
 (0)