Skip to content

Commit 54a1ace

Browse files
committed
Add benchmark regression detection with github-action-benchmark
1 parent 25ea6a9 commit 54a1ace

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,19 @@ jobs:
173173
# Output to both logs and step summary
174174
cat benchmark-table.txt
175175
cat benchmark-table.txt >> $GITHUB_STEP_SUMMARY
176+
- name: Store benchmark result
177+
uses: benchmark-action/github-action-benchmark@v1
178+
with:
179+
tool: 'pytest'
180+
output-file-path: benchmark-results.json
181+
# Store benchmark data in gh-pages branch
182+
gh-pages-branch: gh-pages
183+
benchmark-data-dir-path: dev/bench
184+
# Fail if performance regresses by more than 20%
185+
alert-threshold: '120%'
186+
fail-on-alert: true
187+
# Comment on PR when regression detected
188+
comment-on-alert: true
189+
github-token: ${{ secrets.GITHUB_TOKEN }}
190+
# Only push to gh-pages on main branch
191+
auto-push: ${{ github.ref == 'refs/heads/main' }}

0 commit comments

Comments
 (0)