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

Report benchmarks on PRs from forks #2961

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
23 changes: 0 additions & 23 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,3 @@ jobs:
with:
name: results
path: benches/results/filter_list.json

report_results:
name: Report Results
runs-on: ubuntu-latest
needs:
- bench_text_update
- bench_many_updates
- bench_02_replace1k
- bench_03_update10th1k_x16
- bench_07_create10k
- bench_hydrate1k
- bench_filter_list
steps:
- uses: actions/download-artifact@v2
with:
name: results
path: results
- uses: andrewiggins/tachometer-reporter-action@v2
with:
path: results/*.json
base-bench-name: preact-master
pr-bench-name: preact-local
summarize: 'duration, usedJSHeapSize'
53 changes: 53 additions & 0 deletions .github/workflows/pr-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Report Results to PR

on:
# The pull_request event can't write comments for PRs from forks so using this
# workflow_run workflow as a workaround
workflow_run:
workflows: ['Benchmarks']
branches: ['**']
types:
- completed
- requested

jobs:
report_running:
name: Report benchmarks are in-progress
runs-on: ubuntu-latest
# Only add the "benchmarks are running" text when a workflow_run is
# requested (a.k.a starting)
if: ${{ github.event.action == 'requested' }}
steps:
- name: Report Tachometer Running
uses: andrewiggins/tachometer-reporter-action@v2
with:
# Set initialize to true so this action just creates the comment or
# adds the "benchmarks are running" text
initialize: true

report_results:
name: Report benchmark results
runs-on: ubuntu-latest
# Only run this job if the event action was "completed" and the triggering
# workflow_run was successful
if: >
${{ github.event.action == 'completed' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
# Download the artifact from the triggering workflow that contains the
# Tachometer results to report
- uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
name: results
path: results

# Create/update the comment with the latest results
- name: Report Tachometer Results
uses: andrewiggins/tachometer-reporter-action@v2
with:
path: results/*.json
base-bench-name: preact-master
pr-bench-name: preact-local
summarize: 'duration, usedJSHeapSize'