Repository navigation
59 lines (51 loc) · 1.92 KB
/
Copy pathperformance.yml
File metadata and controls
59 lines (51 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Performance Benchmarks
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install pytest-benchmark
- name: Run performance benchmarks
run: |
pytest tests/performance/ \
--benchmark-only \
--benchmark-json=benchmark-results.json \
--benchmark-min-rounds=10 \
--benchmark-warmup=on \
-v
- name: Store benchmark results
uses: benchmark-action/github-action-benchmark@v1
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
name: Python Performance Benchmarks
tool: "pytest"
output-file-path: benchmark-results.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Alert with commit comment on detecting possible performance regression
alert-threshold: "150%"
comment-on-alert: true
fail-on-alert: false
alert-comment-cc-users: "@Obayne"
- name: Upload benchmark artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: benchmark-results
path: benchmark-results.json