Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/benchmark-comment-trigger.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# This workflow is used to trigger benchmarks on a PR when a specific comment is added
# to the PR. The workflow runs on all PR comments containing the string 'benchmark'
# and the string '@bench-bot'. The workflow collects some information about the PR
# and then forwards the information to the lance-bench workflow.
#
# The lance-bench repository is a public repository in the lancedb organization which
# runs benchmarks against the Lance repository on a regular basis and stores the results
# in a historical database.

name: Benchmark Comment Trigger

on:
issue_comment:
types: [created]

jobs:
forward-to-bench:
# Only process comments on PRs that mention @bench-bot and contain 'benchmark'
if: |
github.event.issue.pull_request != null &&
contains(github.event.comment.body, '@bench-bot') &&
contains(github.event.comment.body, 'benchmark')
runs-on: ubuntu-latest
steps:
- name: Get PR details
id: pr
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});

core.setOutput('head_sha', pr.data.head.sha);

- name: Forward to lance-bench
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.LANCE_BENCH_DISPATCH_TOKEN }}
repository: lancedb/lance-bench
event-type: pr-comment
client-payload: |
{
"comment_body": ${{ toJson(github.event.comment.body) }},
"comment_user": "${{ github.event.comment.user.login }}",
"pr_number": ${{ github.event.issue.number }},
"pr_head_sha": "${{ steps.pr.outputs.head_sha }}",
"repository": "${{ github.repository }}"
}