Skip to content

Commit

Permalink
chore: script/mathlib-bench (#6280)
Browse files Browse the repository at this point in the history
A simple approach to benchmarking lean4 PRs against Mathlib
  • Loading branch information
Kha authored Dec 2, 2024
1 parent b3e0c9c commit 6fcf35e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions script/mathlib-bench
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/env bash
# Open a Mathlib4 PR for benchmarking a given Lean 4 PR

set -euo pipefail

[ $# -eq 1 ] || (echo "usage: $0 <lean4 PR #>"; exit 1)

LEAN_PR=$1
PR_RESPONSE=$(gh api repos/leanprover-community/mathlib4/pulls -X POST -f head=lean-pr-testing-$LEAN_PR -f base=nightly-testing -f title="leanprover/lean4#$LEAN_PR benchmarking" -f draft=true -f body="ignore me")
PR_NUMBER=$(echo "$PR_RESPONSE" | jq '.number')
echo "opened https://github.com/leanprover-community/mathlib4/pull/$PR_NUMBER"
gh api repos/leanprover-community/mathlib4/issues/$PR_NUMBER/comments -X POST -f body="!bench" > /dev/null

0 comments on commit 6fcf35e

Please sign in to comment.