-
-
Notifications
You must be signed in to change notification settings - Fork 2k
76 lines (71 loc) · 2.4 KB
/
pr-reporter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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: ['CI']
branches: ['**']
types:
- completed
- requested
jobs:
filter_jobs:
name: Filter jobs
runs-on: ubuntu-latest
if: |
github.event.workflow_run.event == 'pull_request'
outputs:
jsChanged: ${{ steps.filter.outputs.jsChanged }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
ref: ${{ github.event.workflow_run.head_branch }}
# Should be kept in sync with the filter in the CI workflow
filters: |
jsChanged: '**/src/**/*.js'
report_running:
name: Report benchmarks are in-progress
needs: filter_jobs
runs-on: ubuntu-latest
# Only add the "benchmarks are running" text when a workflow_run is
# requested (a.k.a starting)
if: |
needs.filter_jobs.outputs.jsChanged == 'true' &&
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
needs: filter_jobs
runs-on: ubuntu-latest
# Only run this job if the event action was "completed" and the triggering
# workflow_run was successful
if: |
needs.filter_jobs.outputs.jsChanged == 'true' &&
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_is_regexp: true
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-main
pr-bench-name: preact-local
summarize: 'duration, usedJSHeapSize'