Skip to content

Commit 6b70362

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

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/ci.yml

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

0 commit comments

Comments
 (0)