@@ -2,6 +2,9 @@ name: benchmarks
22
33on : [pull_request]
44
5+ permissions :
6+ contents : read
7+
58jobs :
69 size :
710 runs-on : ubuntu-latest
@@ -33,24 +36,16 @@ jobs:
3336 npm run size -w benchmarks -- -o ${{ env.PATCH_JSON }}
3437 echo "Ran successfully on patch branch"
3538 - name : ' Collect results'
36- id : collect
3739 run : |
38- echo "table<<EOF" >> $GITHUB_OUTPUT
39- node packages/benchmarks/compare.js ${{ env.BASE_JSON }} ${{ env.PATCH_JSON }} >> markdown
40- cat markdown >> $GITHUB_OUTPUT
41- echo "EOF" >> $GITHUB_OUTPUT
42- - name : ' Post comment'
43- uses : edumserrano/find-create-or-update-comment@v3
40+ mkdir -p benchmark-output
41+ echo "${{ github.event.pull_request.number }}" > benchmark-output/pr-number.txt
42+ node packages/benchmarks/compare.js ${{ env.BASE_JSON }} ${{ env.PATCH_JSON }} > benchmark-output/table.md
43+ - name : ' Upload results'
44+ uses : actions/upload-artifact@v4
4445 with :
45- issue-number : ${{ github.event.pull_request.number }}
46- body-includes : ' <!-- workflow-benchmarks-size-data -->'
47- comment-author : ' github-actions[bot]'
48- body : |
49- <!-- workflow-benchmarks-size-data -->
50- ### workflow: benchmarks/size
51- Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.
52- ${{ steps.collect.outputs.table }}
53- edit-mode : replace
46+ name : benchmarks-size
47+ path : benchmark-output/
48+ retention-days : 1
5449
5550 perf :
5651 runs-on : ubuntu-latest
@@ -82,21 +77,13 @@ jobs:
8277 npm run perf -w benchmarks -- -o ${{ env.PATCH_JSON }}
8378 echo "Ran successfully on patch branch"
8479 - name : ' Collect results'
85- id : collect
8680 run : |
87- echo "table<<EOF" >> $GITHUB_OUTPUT
88- node packages/benchmarks/compare.js ${{ env.BASE_JSON }} ${{ env.PATCH_JSON }} >> markdown
89- cat markdown >> $GITHUB_OUTPUT
90- echo "EOF" >> $GITHUB_OUTPUT
91- - name : ' Post comment'
92- uses : edumserrano/find-create-or-update-comment@v3
81+ mkdir -p benchmark-output
82+ echo "${{ github.event.pull_request.number }}" > benchmark-output/pr-number.txt
83+ node packages/benchmarks/compare.js ${{ env.BASE_JSON }} ${{ env.PATCH_JSON }} > benchmark-output/table.md
84+ - name : ' Upload results'
85+ uses : actions/upload-artifact@v4
9386 with :
94- issue-number : ${{ github.event.pull_request.number }}
95- body-includes : ' <!-- workflow-benchmarks-perf-data -->'
96- comment-author : ' github-actions[bot]'
97- body : |
98- <!-- workflow-benchmarks-perf-data -->
99- ### workflow: benchmarks/perf (native)
100- Comparison of performance test results, measured in operations per second. Larger is better.
101- ${{ steps.collect.outputs.table }}
102- edit-mode : replace
87+ name : benchmarks-perf
88+ path : benchmark-output/
89+ retention-days : 1
0 commit comments