Skip to content

Commit

Permalink
action: run-benchdiff (#1530)
Browse files Browse the repository at this point in the history
  • Loading branch information
v1v authored Nov 16, 2023
1 parent b3a0425 commit 12b35a4
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,63 @@ jobs:
- name: Unit tests
run: make test

run-benchdiff:
runs-on: ubuntu-latest
permissions:
checks: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: stable
cache-dependency-path: '**/go.sum'
# Version: https://github.com/WillAbides/benchdiff-action/releases/tag/v0.3.3
- uses: WillAbides/benchdiff-action@4d1d267fa96763646dd7c0d58e242817ce392c61
## As long as we cannot use write permissions on forked pull requests, then let's avoid failing
continue-on-error: true
id: benchdiff
with:
benchdiff_version: 0.9.1
status_sha: ${{ github.sha }}
status_name: benchdiff-result
status_on_degraded: neutral
# See https://github.com/WillAbides/benchdiff
benchdiff_args: |
--base-ref=origin/main
--cpu=1,2
--count=5
--warmup-count=1
--warmup-time=10ms
--benchtime=100ms
--tolerance=20
--benchmem
--debug
- name: Summary
run: |
echo "${{ steps.benchdiff.outputs.benchstat_output }}" > benchdiff-report.md
{
echo "## Benchdiff Results"
echo ""
echo 'Head: `${{ steps.benchdiff.outputs.head_sha }}`'
echo 'Base: `${{ steps.benchdiff.outputs.base_sha }}`'
echo 'Degraded: `${{ steps.benchdiff.outputs.degraded_result }}`'
echo ""
echo "<details>"
echo "<summary>See results</summary>"
echo ""
echo "${{ steps.benchdiff.outputs.benchstat_output }}"
echo ""
echo "</details>"
} >> $GITHUB_STEP_SUMMARY
- uses: actions/upload-artifact@v3
with:
name: benchdiff-report
path: benchdiff-report.md

# Very last job to create a GitHub check with the status. This is handy to centralise the
# GitHub check validation in the Branch protection and to support the ci-docs.yml
ci:
Expand Down

0 comments on commit 12b35a4

Please sign in to comment.