7
7
type : string
8
8
default : benchmark
9
9
required : false
10
-
10
+ pr-repo :
11
+ type : string
12
+ default : ${{ github.event.pull_request.head.repo.full_name }}
13
+ required : false
14
+ pr-sha :
15
+ type : string
16
+ default : ${{ github.event.pull_request.head.sha }}
17
+ required : false
18
+ pr-ref :
19
+ type : string
20
+ default : ${{ github.event.pull_request.head.ref }}
21
+ required : false
22
+ base-repo :
23
+ type : string
24
+ default : ${{ github.event.pull_request.base.repo.full_name }}
25
+ required : false
26
+ base-sha :
27
+ type : string
28
+ default : ${{ github.event.pull_request.base.sha }}
29
+ required : false
30
+ base-ref :
31
+ type : string
32
+ default : ${{ github.event.pull_request.base.ref }}
33
+ required : false
11
34
jobs :
12
35
benchmark :
13
36
if : ${{ github.event.label.name == 'benchmark' }}
@@ -18,47 +41,49 @@ jobs:
18
41
PR-BENCH-18 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT_18 }}
19
42
PR-BENCH-20 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT_20 }}
20
43
PR-BENCH-21 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT_21 }}
21
- DEFAULT -BENCH-18 : ${{ steps.benchmark-default .outputs.BENCH_RESULT_18 }}
22
- DEFAULT -BENCH-20 : ${{ steps.benchmark-default .outputs.BENCH_RESULT_20 }}
23
- DEFAULT -BENCH-21 : ${{ steps.benchmark-default .outputs.BENCH_RESULT_21 }}
44
+ BASE -BENCH-18 : ${{ steps.benchmark-base .outputs.BENCH_RESULT_18 }}
45
+ BASE -BENCH-20 : ${{ steps.benchmark-base .outputs.BENCH_RESULT_20 }}
46
+ BASE -BENCH-21 : ${{ steps.benchmark-base .outputs.BENCH_RESULT_21 }}
24
47
25
48
strategy :
26
49
matrix :
27
50
node-version : [18, 20, 21]
28
51
steps :
29
- - uses : actions/checkout@v4
52
+ - name : Checkout ${{ inputs.pr-repo }}@${{ inputs.pr-ref }}
53
+ uses : actions/checkout@v4
30
54
with :
31
55
persist-credentials : false
32
- ref : ${{github.event.pull_request.head. sha}}
33
- repository : ${{github.event.pull_request.head. repo.full_name }}
56
+ ref : ${{ inputs.pr- sha }}
57
+ repository : ${{ inputs.pr- repo }}
34
58
35
59
- uses : actions/setup-node@v4
36
60
with :
37
61
node-version : ${{ matrix.node-version }}
38
62
39
- - name : Install
63
+ - name : Install ${{ inputs.pr-repo }}@${{ inputs.pr-ref }}
40
64
run : |
41
65
npm install --ignore-scripts
42
66
43
- - name : Run benchmark
67
+ - name : Run benchmark ${{ inputs.pr-repo }}@${{ inputs.pr-ref }}
44
68
id : benchmark-pr
45
69
run : |
46
70
echo 'BENCH_RESULT_${{matrix.node-version}}<<EOF' >> $GITHUB_OUTPUT
47
71
npm run --silent ${{inputs.npm-script}} >> $GITHUB_OUTPUT
48
72
echo 'EOF' >> $GITHUB_OUTPUT
49
73
50
- - uses : actions/checkout@v4
74
+ - name : Checkout ${{ inputs.base-repo }}@${{ inputs.base-ref }}
75
+ uses : actions/checkout@v4
51
76
with :
52
77
persist-credentials : false
53
- ref : refs/heads/ ${{ github.event.repository.default_branch }}
54
- repository : ${{github.event.pull_request.head. repo.full_name }}
78
+ ref : ${{ inputs.base-sha }}
79
+ repository : ${{ inputs.base- repo }}
55
80
56
- - name : Install
81
+ - name : Install ${{ inputs.base-repo }}@${{ inputs.base-ref }}
57
82
run : |
58
83
npm install --ignore-scripts
59
84
60
- - name : Run benchmark
61
- id : benchmark-default
85
+ - name : Run benchmark ${{ inputs.base-repo }}@${{ inputs.base-ref }}
86
+ id : benchmark-base
62
87
run : |
63
88
echo 'BENCH_RESULT_${{matrix.node-version}}<<EOF' >> $GITHUB_OUTPUT
64
89
npm run --silent ${{inputs.npm-script}} >> $GITHUB_OUTPUT
@@ -77,35 +102,35 @@ jobs:
77
102
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
78
103
message : |
79
104
**Node**: 18
80
- ** ${{github.event.pull_request.head. ref}}** :
105
+ ${{ inputs.pr-repo }}@${{ inputs.pr-sha }} (${{ inputs.pr- ref }}) :
81
106
```
82
107
${{ needs.benchmark.outputs.PR-BENCH-18 }}
83
108
```
84
- ** ${{ github.event.repository.default_branch }}** :
109
+ ${{ inputs.base-repo }}@${{ inputs.base-sha }} (${{ inputs.base-ref }}) :
85
110
```
86
- ${{ needs.benchmark.outputs.DEFAULT -BENCH-18 }}
111
+ ${{ needs.benchmark.outputs.BASE -BENCH-18 }}
87
112
```
88
113
89
114
---
90
115
91
116
**Node**: 20
92
- ** ${{github.event.pull_request.head. ref}}** :
117
+ ${{ inputs.pr-repo }}@${{ inputs.pr-sha }} (${{ inputs.pr- ref }}) :
93
118
```
94
119
${{ needs.benchmark.outputs.PR-BENCH-20 }}
95
120
```
96
- ** ${{ github.event.repository.default_branch }}** :
121
+ ${{ inputs.base-repo }}@${{ inputs.base-sha }} (${{ inputs.base-ref }}) :
97
122
```
98
- ${{ needs.benchmark.outputs.DEFAULT -BENCH-20 }}
123
+ ${{ needs.benchmark.outputs.BASE -BENCH-20 }}
99
124
```
100
125
101
126
---
102
127
103
128
**Node**: 21
104
- ** ${{github.event.pull_request.head. ref}}** :
129
+ ${{ inputs.pr-repo }}@${{ inputs.pr-sha }} (${{ inputs.pr- ref }}) :
105
130
```
106
131
${{ needs.benchmark.outputs.PR-BENCH-21 }}
107
132
```
108
- ** ${{ github.event.repository.default_branch }}** :
133
+ ${{ inputs.base-repo }}@${{ inputs.base-sha }} (${{ inputs.base-ref }}) :
109
134
```
110
- ${{ needs.benchmark.outputs.DEFAULT -BENCH-21 }}
135
+ ${{ needs.benchmark.outputs.BASE -BENCH-21 }}
111
136
```
0 commit comments