Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugins-benchmark-pr): run comparison benchmark against target #120

Merged
57 changes: 40 additions & 17 deletions .github/workflows/plugins-benchmark-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,30 @@ on:
type: string
default: benchmark
required: false

source_repo:
type: string
default: ${{ github.event.pull_request.head.repo.full_name }}
required: false
source_sha:
type: string
default: ${{ github.event.pull_request.head.sha }}
required: false
source_ref:
type: string
default: ${{ github.event.pull_request.head.ref }}
required: false
target_repo:
type: string
default: ${{ github.event.pull_request.base.repo.full_name }}
required: false
target_sha:
type: string
default: ${{ github.event.pull_request.base.sha }}
required: false
target_ref:
type: string
default: ${{ github.event.pull_request.base.ref }}
required: false
jobs:
benchmark:
if: ${{ github.event.label.name == 'benchmark' }}
Expand All @@ -18,9 +41,9 @@ jobs:
PR-BENCH-18: ${{ steps.benchmark-pr.outputs.BENCH_RESULT_18 }}
PR-BENCH-20: ${{ steps.benchmark-pr.outputs.BENCH_RESULT_20 }}
PR-BENCH-21: ${{ steps.benchmark-pr.outputs.BENCH_RESULT_21 }}
DEFAULT-BENCH-18: ${{ steps.benchmark-default.outputs.BENCH_RESULT_18 }}
DEFAULT-BENCH-20: ${{ steps.benchmark-default.outputs.BENCH_RESULT_20 }}
DEFAULT-BENCH-21: ${{ steps.benchmark-default.outputs.BENCH_RESULT_21 }}
TARGET-BENCH-18: ${{ steps.benchmark-default.outputs.BENCH_RESULT_18 }}
TARGET-BENCH-20: ${{ steps.benchmark-default.outputs.BENCH_RESULT_20 }}
TARGET-BENCH-21: ${{ steps.benchmark-default.outputs.BENCH_RESULT_21 }}
mweberxyz marked this conversation as resolved.
Show resolved Hide resolved

strategy:
matrix:
Expand All @@ -29,8 +52,8 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: ${{github.event.pull_request.head.sha}}
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{ inputs.source_sha }}
repository: ${{ inputs.source_repo }}

- uses: actions/setup-node@v4
with:
Expand All @@ -50,8 +73,8 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
ref: refs/heads/${{ github.event.repository.default_branch }}
repository: ${{github.event.pull_request.head.repo.full_name}}
ref: ${{ inputs.target_sha }}
repository: ${{ inputs.target_repo }}

- name: Install
run: |
Expand All @@ -77,35 +100,35 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
**Node**: 18
**${{github.event.pull_request.head.ref}}**:
${{ inputs.source_repo }}@${{ inputs.source_sha }} (${{ inputs.source_ref }}):
```
${{ needs.benchmark.outputs.PR-BENCH-18 }}
```
**${{ github.event.repository.default_branch }}**:
${{ inputs.target_repo }}@${{ inputs.target_sha }} (${{ inputs.target_ref }}):
```
${{ needs.benchmark.outputs.DEFAULT-BENCH-18 }}
${{ needs.benchmark.outputs.TARGET-BENCH-18 }}
```

---

**Node**: 20
**${{github.event.pull_request.head.ref}}**:
${{ inputs.source_repo }}@${{ inputs.source_sha }} (${{ inputs.source_ref }}):
```
${{ needs.benchmark.outputs.PR-BENCH-20 }}
```
**${{ github.event.repository.default_branch }}**:
${{ inputs.target_repo }}@${{ inputs.target_sha }} (${{ inputs.target_ref }}):
```
${{ needs.benchmark.outputs.DEFAULT-BENCH-20 }}
${{ needs.benchmark.outputs.TARGET-BENCH-20 }}
```

---

**Node**: 21
**${{github.event.pull_request.head.ref}}**:
${{ inputs.source_repo }}@${{ inputs.source_sha }} (${{ inputs.source_ref }}):
```
${{ needs.benchmark.outputs.PR-BENCH-21 }}
```
**${{ github.event.repository.default_branch }}**:
${{ inputs.target_repo }}@${{ inputs.target_sha }} (${{ inputs.target_ref }}):
```
${{ needs.benchmark.outputs.DEFAULT-BENCH-21 }}
${{ needs.benchmark.outputs.TARGET-BENCH-21 }}
```