Skip to content

New benchmarks infrastructure #3

New benchmarks infrastructure

New benchmarks infrastructure #3

Workflow file for this run

# Run all benchmarks when a comment containing "test performance please"
# comment is posted on a PR.
name: Benchmarks comments handler
on:
issue_comment:
types: [created]
jobs:
pr_data:
name: Handle comment
if: github.event.issue.pull_request && contains(github.event.comment.body, 'test performance please')
runs-on: ubuntu-latest
steps:
- name: Get PR data
uses: actions/github-script@v7
with:
script: |
const { data } = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
console.log(JSON.stringify(data, null, 2));
core.exportVariable('BASE_SHA', data.base.sha);
core.exportVariable('HEAD_SHA', data.head.sha);
core.exportVariable('HEAD_REPO', data.head.repo.full_name);
outputs:
BASE_SHA: ${{ env.BASE_SHA }}
HEAD_SHA: ${{ env.HEAD_SHA }}
HEAD_REPO: ${{ env.HEAD_REPO }}
benchmark_base_commit:
name: Benchmark base commit
uses: ./.github/workflows/bench.yml
needs: pr_data
with:
commit: ${{ needs.pr_data.outputs.BASE_SHA }}
repo: "scala/scala3"
run: 0
is_last_run: false
benchmark_last_commit:
name: Benchmark last PR commit
uses: ./.github/workflows/bench.yml
needs: pr_data
with:
commit: ${{ needs.pr_data.outputs.HEAD_SHA }}
repo: ${{ needs.pr_data.outputs.HEAD_REPO }}
run: 0
is_last_run: true