@@ -12,16 +12,18 @@ jobs:
1212 BASE_SHA : ${{ github.event.pull_request.base.sha }}
1313 BASE_DIR : base
1414 BASE_MASSIF_OUT : base-perf.out
15+ BASE_REPORT : base-perf.txt
1516 HEAD_REPO : ${{ github.event.pull_request.head.repo.owner.login }}/${{ github.event.pull_request.head.repo.name }}
1617 HEAD_SHA : ${{ github.event.pull_request.head.sha }}
1718 HEAD_DIR : head
1819 HEAD_MASSIF_OUT : head-perf.out
20+ HEAD_REPORT : head-perf.txt
1921 TEST_REPO : microsoft/TypeScript
2022 TEST_REF : v4.9.5
2123 TEST_DIR : test
2224 TEST_SRC : src/compiler/binder.ts
2325 TSSG_TS : tree-sitter-stack-graphs-typescript
24- REPORT_COMMENT : perf-report .json
26+ COMMENT_JSON : perf-summary .json
2527 steps :
2628 #
2729 # Install tools
@@ -122,19 +124,30 @@ jobs:
122124 repository : ${{ env.HEAD_REPO }}
123125 ref : ${{ env.HEAD_SHA }}
124126 path : ${{ env.HEAD_DIR }}
125- - name : Generate report
127+ - name : Generate reports and summary
126128 run : |
127- ${{ env.HEAD_DIR }}/script/ci-perf-report-md \
129+ ms_print ${{ env.BASE_MASSIF_OUT }} > ${{ env.BASE_REPORT }}
130+ ms_print ${{ env.HEAD_MASSIF_OUT }} > ${{ env.HEAD_REPORT }}
131+ ${{ env.HEAD_DIR }}/script/ci-perf-summary-md \
128132 ${{ env.BASE_MASSIF_OUT }} \
129133 ${{ env.HEAD_MASSIF_OUT }} \
130- 'Comparing base ${{ env.BASE_REPO }}@${{ env.BASE_SHA }} with head ${{ env.HEAD_REPO }}@${{ env.HEAD_SHA }} on `${{ env.TEST_SRC }}` in ${{ env.TEST_REPO }}@${{ env.TEST_REF }}.' \
131- | ${{ env.HEAD_DIR }}/script/ci-comment-json >> ${{ env.REPORT_COMMENT }}
132- - name : Add report comment to PR
134+ 'Comparing base ${{ env.BASE_REPO }}@${{ env.BASE_SHA }} with head ${{ env.HEAD_REPO }}@${{ env.HEAD_SHA }} on `${{ env.TEST_SRC }}` in ${{ env.TEST_REPO }}@${{ env.TEST_REF }}. For details see [workflow](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}) artifacts.' \
135+ | ${{ env.HEAD_DIR }}/script/ci-comment-json > ${{ env.COMMENT_JSON }}
136+ - name : Upload reports
137+ uses : actions/upload-artifact@v3
138+ with :
139+ name : perf
140+ path : |
141+ ${{ env.BASE_MASSIF_OUT }}
142+ ${{ env.BASE_REPORT }}
143+ ${{ env.HEAD_MASSIF_OUT }}
144+ ${{ env.HEAD_REPORT }}
145+ - name : Add summary comment to PR
133146 run : |
134147 curl \
135148 -X POST \
136149 -H "Accept: application/vnd.github+json" \
137150 -H "Authorization: Bearer ${{ github.TOKEN }}" \
138151 -H "X-GitHub-Api-Version: 2022-11-28" \
139152 ${{ github.event.pull_request.comments_url }} \
140- -d '@${{ env.REPORT_COMMENT }}'
153+ -d '@${{ env.COMMENT_JSON }}'
0 commit comments