Skip to content

Commit

Permalink
tests(ci): upload benchmark artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
msaf1980 committed Mar 18, 2023
1 parent f050f86 commit 978665c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,21 @@ jobs:
run: |
cp ${{ env.TMP_DIR }}/bench-base.txt ${{ env.TMP_DIR }}/bench-pr.txt .
set -euo pipefail
qbenchstat -increasing 'match/s' -threshold 2 -format html bench-base.txt bench-pr.txt > ${{ env.TMP_DIR }}/benchcmp.html
#qbenchstat -increasing 'match/s' -format html bench-base.txt bench-pr.txt | tee benchcmp-${{ matrix.go-version }}.html
qbenchstat -increasing 'match/s' -threshold 2 -format html bench-base.txt bench-pr.txt > ${{ env.TMP_DIR }}/benchstat.html
qbenchstat -increasing 'match/s' -format html bench-base.txt bench-pr.txt > benchstat-${{ matrix.go-version }}.html
- name: Upload Benchstat
uses: actions/upload-artifact@v2
with:
name: benchstat
path: benchstat-${{ matrix.go-version }}.html

- name: Create comment PR
run: |
echo 'Benchmark comparison for golang ${{ matrix.go-version }} on [${{ github.event.pull_request.head.sha }}](${{ github.event.repository.html_url }}/commit/${{ github.event.pull_request.head.sha }}) (${{ github.event.pull_request.head.ref }}) vs [${{ github.event.pull_request.base.sha }}](${{ github.event.repository.html_url }}/commit/${{ github.event.pull_request.base.sha }}) (${{ github.event.pull_request.base.ref }})' > ${{ env.TMP_DIR }}/pr_comment
echo "<details><summary>Benchmark diff</summary>" >> ${{ env.TMP_DIR }}/pr_comment
cat ${{ env.TMP_DIR }}/benchcmp.html >> ${{ env.TMP_DIR }}/pr_comment
cat ${{ env.TMP_DIR }}/benchstat.html >> ${{ env.TMP_DIR }}/pr_comment
echo "</details>" >> ${{ env.TMP_DIR }}/pr_comment
# echo "<details><summary>Benchmark result</summary>" >> ${{ env.TMP_DIR }}/pr_comment
Expand Down

0 comments on commit 978665c

Please sign in to comment.