1
- name : Benchmark
1
+ name : Benchmark PR
2
2
3
3
on :
4
4
pull_request_target :
11
11
permissions :
12
12
contents : read
13
13
outputs :
14
- PR-BENCH-14 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT14 }}
15
- PR-BENCH-16 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT16 }}
16
- PR-BENCH-18 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT18 }}
17
- PR-BENCH-20 : ${{ steps.benchmark-pr.outputs.BENCH_RESULT20 }}
18
- MASTER-BENCH-14 : ${{ steps.benchmark-master.outputs.BENCH_RESULT14 }}
19
- MASTER-BENCH-16 : ${{ steps.benchmark-master.outputs.BENCH_RESULT16 }}
20
- MASTER-BENCH-18 : ${{ steps.benchmark-master.outputs.BENCH_RESULT18 }}
21
- MASTER-BENCH-20 : ${{ steps.benchmark-master.outputs.BENCH_RESULT20 }}
22
- strategy :
23
- matrix :
24
- node-version : [14, 16, 18, 20]
14
+ PR-BENCH : ${{ steps.benchmark-pr.outputs.BENCH_RESULT }}
15
+ MASTER-BENCH : ${{ steps.benchmark-master.outputs.BENCH_RESULT }}
25
16
steps :
26
17
- uses : actions/checkout@v3
27
18
with :
31
22
32
23
- uses : actions/setup-node@v3
33
24
with :
34
- node-version : ${{ matrix.node-version }}
25
+ node-version : 18
35
26
36
27
- name : Install
37
28
run : |
@@ -40,12 +31,12 @@ jobs:
40
31
- name : Run benchmark
41
32
id : benchmark-pr
42
33
run : |
43
- npm run --silent benchmark > ./bench-result
34
+ npm run --silent bench > ./bench-result
44
35
content=$(cat ./bench-result)
45
36
content="${content//'%'/'%25'}"
46
37
content="${content//$'\n'/'%0A'}"
47
38
content="${content//$'\r'/'%0D'}"
48
- echo "::set-output name=BENCH_RESULT${{matrix.node-version}} ::$content"
39
+ echo "::set-output name=BENCH_RESULT::$content"
49
40
50
41
# master benchmark
51
42
- uses : actions/checkout@v3
@@ -59,14 +50,15 @@ jobs:
59
50
- name : Run benchmark
60
51
id : benchmark-master
61
52
run : |
62
- npm run --silent benchmark > ./bench-result
53
+ npm run --silent bench > ./bench-result
63
54
content=$(cat ./bench-result)
64
55
content="${content//'%'/'%25'}"
65
56
content="${content//$'\n'/'%0A'}"
66
57
content="${content//$'\r'/'%0D'}"
67
- echo "::set-output name=BENCH_RESULT${{matrix.node-version}} ::$content"
58
+ echo "::set-output name=BENCH_RESULT::$content"
68
59
69
60
output-benchmark :
61
+ if : " always()"
70
62
needs : [benchmark]
71
63
runs-on : ubuntu-latest
72
64
permissions :
@@ -77,49 +69,13 @@ jobs:
77
69
with :
78
70
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79
71
message : |
80
- **Node**: 14
81
72
**PR**:
82
73
```
83
- ${{ needs.benchmark.outputs.PR-BENCH-14 }}
74
+ ${{ needs.benchmark.outputs.PR-BENCH }}
84
75
```
85
76
**MASTER**:
86
77
```
87
- ${{ needs.benchmark.outputs.MASTER-BENCH-14 }}
88
- ```
89
-
90
- ---
91
-
92
- **Node**: 16
93
- **PR**:
94
- ```
95
- ${{ needs.benchmark.outputs.PR-BENCH-16 }}
96
- ```
97
- **MASTER**:
98
- ```
99
- ${{ needs.benchmark.outputs.MASTER-BENCH-16 }}
100
- ```
101
-
102
- ---
103
-
104
- **Node**: 18
105
- **PR**:
106
- ```
107
- ${{ needs.benchmark.outputs.PR-BENCH-18 }}
108
- ```
109
- **MASTER**:
110
- ```
111
- ${{ needs.benchmark.outputs.MASTER-BENCH-18 }}
112
-
113
- ---
114
-
115
- **Node**: 20
116
- **PR**:
117
- ```
118
- ${{ needs.benchmark.outputs.PR-BENCH-20 }}
119
- ```
120
- **MASTER**:
121
- ```
122
- ${{ needs.benchmark.outputs.MASTER-BENCH-20 }}
78
+ ${{ needs.benchmark.outputs.MASTER-BENCH }}
123
79
```
124
80
125
81
- uses : actions-ecosystem/action-remove-labels@v1
0 commit comments