Skip to content

Commit

Permalink
feature(plugins-benchmark-pr): factor up repos and refs and include i…
Browse files Browse the repository at this point in the history
…n output
  • Loading branch information
mweberxyz committed Feb 20, 2024
1 parent edeb892 commit 9c0cccd
Showing 1 changed file with 40 additions and 17 deletions.
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 }}

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.pull_request.base.repo.default_branch}}
repository: ${{github.event.pull_request.base.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 }}
```

0 comments on commit 9c0cccd

Please sign in to comment.