-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into MR-remove-lintstyle.sh
- Loading branch information
Showing
2,506 changed files
with
47,094 additions
and
26,684 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
name: Bump lean-toolchain on nightly-testing | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 10 * * *' # 11AM CET/2AM PT, 3 hours after lean4 starts building the nightly. | ||
- cron: '0 10/3 * * *' # Run every three hours, starting at 11AM CET/2AM PT. | ||
|
||
jobs: | ||
update-toolchain: | ||
|
@@ -30,5 +31,6 @@ jobs: | |
git config user.name "leanprover-community-mathlib4-bot" | ||
git config user.email "[email protected]" | ||
git add lean-toolchain | ||
git commit -m "chore: bump to ${RELEASE_TAG}" | ||
# Don't fail if there's nothing to commit | ||
git commit -m "chore: bump to ${RELEASE_TAG}" || true | ||
git push origin nightly-testing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
type: 'stream' | ||
topic: 'Mathlib status updates' | ||
content: | | ||
❌ The latest CI for Mathlib's branch#nightly-testing has [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}). | ||
❌ The latest CI for Mathlib's branch#nightly-testing has [failed](https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }}) ([${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})). | ||
handle_success: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'nightly-testing' }} | ||
|
@@ -50,6 +50,7 @@ jobs: | |
git tag "nightly-testing-${version}" | ||
git push origin "nightly-testing-${version}" | ||
hash="$(git rev-parse "nightly-testing-${version}")" | ||
printf 'SHA=%s\n' "${hash}" >> "${GITHUB_ENV}" | ||
curl -X POST "http://speed.lean-fro.org/mathlib4/api/queue/commit/e7b27246-a3e6-496a-b552-ff4b45c7236e/$hash" -u "admin:${{ secrets.SPEED }}" | ||
fi | ||
else | ||
|
@@ -83,9 +84,15 @@ jobs: | |
run: pip install zulip | ||
|
||
- name: Check last message and post if necessary | ||
env: | ||
ZULIP_EMAIL: '[email protected]' | ||
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }} | ||
ZULIP_SITE: 'https://leanprover.zulipchat.com' | ||
SHA: ${{ env.SHA }} | ||
run: | | ||
import os | ||
import zulip | ||
client = zulip.Client(email='[email protected]', api_key='${{ secrets.ZULIP_API_KEY }}', site='https://leanprover.zulipchat.com') | ||
client = zulip.Client(email=os.getenv('ZULIP_EMAIL'), api_key=os.getenv('ZULIP_API_KEY'), site=os.getenv('ZULIP_SITE')) | ||
# Get the last message in the 'status updates' topic | ||
request = { | ||
|
@@ -97,20 +104,19 @@ jobs: | |
} | ||
response = client.get_messages(request) | ||
messages = response['messages'] | ||
if not messages or messages[0]['content'] != "✅ The latest CI for Mathlib's branch#nightly-testing has succeeded!": | ||
if not messages or messages[0]['content'] != f"✅ The latest CI for Mathlib's branch#nightly-testing has succeeded! ([{os.getenv('SHA')}](https://github.com/${{ github.repository }}/commit/{os.getenv('SHA')}))": | ||
# Post the success message | ||
request = { | ||
'type': 'stream', | ||
'to': 'nightly-testing', | ||
'topic': 'Mathlib status updates', | ||
'content': "✅ The latest CI for Mathlib's branch#nightly-testing has succeeded!" | ||
'content': f"✅ The latest CI for Mathlib's branch#nightly-testing has succeeded! ([{os.getenv('SHA')}](https://github.com/${{ github.repository }}/commit/{os.getenv('SHA')}))" | ||
} | ||
result = client.send_message(request) | ||
print(result) | ||
shell: python | ||
|
||
# Next, determine if we should remind the humans to create a new PR to the `bump/v4.X.0` branch. | ||
# https://chat.openai.com/share/504882f9-9d98-4d8d-ad19-5161c4a24fe1 | ||
|
||
- name: Check for matching bump/nightly-YYYY-MM-DD branch | ||
id: check_branch | ||
|
@@ -176,16 +182,18 @@ jobs: | |
env: | ||
BUMP_VERSION: ${{ steps.bump_version.outputs.result }} | ||
BUMP_BRANCH: ${{ steps.latest_bump_branch.outputs.result }} | ||
SHA: ${{ env.SHA }} | ||
ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }} | ||
shell: python | ||
run: | | ||
import os | ||
import zulip | ||
client = zulip.Client(email='[email protected]', api_key='${{ secrets.ZULIP_API_KEY }}', site='https://leanprover.zulipchat.com') | ||
client = zulip.Client(email='[email protected]', api_key=os.getenv('ZULIP_API_KEY'), site='https://leanprover.zulipchat.com') | ||
current_version = os.getenv('NIGHTLY') | ||
bump_version = os.getenv('BUMP_VERSION') | ||
bump_branch = os.getenv('BUMP_BRANCH') | ||
print(f'Current version: {current_version}, Bump version: {bump_version}') | ||
sha = os.getenv('SHA') | ||
print(f'Current version: {current_version}, Bump version: {bump_version}, SHA: {sha}') | ||
if current_version > bump_version: | ||
print('Lean toolchain in `nightly-testing` is ahead of the bump branch.') | ||
# Get the last message in the 'Mathlib bump branch reminders' topic | ||
|
@@ -199,7 +207,7 @@ jobs: | |
response = client.get_messages(request) | ||
messages = response['messages'] | ||
bump_branch_suffix = bump_branch.replace('bump/', '') | ||
payload = f"🛠️: it looks like it's time to create a new bump/nightly-{current_version} branch from nightly-testing, and then PR that to {bump_branch}. " | ||
payload = f"🛠️: it looks like it's time to create a new bump/nightly-{current_version} branch from nightly-testing (specifically {sha}), and then PR that to {bump_branch}. " | ||
payload += "To do so semi-automatically, run the following script from mathlib root:\n\n" | ||
payload += f"```bash\n./scripts/create-adaptation-pr.sh {bump_branch_suffix} {current_version}\n```\n" | ||
# Only post if the message is different | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.