-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (46 loc) · 1.46 KB
/
benchmark.yml
File metadata and controls
56 lines (46 loc) · 1.46 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
name: Benchmarks
on:
pull_request:
branches:
- master
jobs:
benchmark:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Set up Python 3.14
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Install dependencies
run: uv sync
# On PRs: run benchmarks twice (PR code vs master code) and compare
- name: Run benchmarks
run: |
# Checkout master version of patchdiff directory
git fetch origin master
git checkout origin/master -- patchdiff/
# Run benchmarks with master code as baseline
uv run --no-sync pytest benchmarks/benchmark.py \
--benchmark-only \
--benchmark-save=master \
--benchmark-sort=mean || true
# Restore PR code
git checkout HEAD -- patchdiff/
# Run benchmarks on PR code and compare
uv run --no-sync pytest benchmarks/benchmark.py \
--benchmark-only \
--benchmark-compare \
--benchmark-compare-fail=mean:5% \
--benchmark-save=branch \
--benchmark-sort=mean
- name: Upload benchmarks
if: always()
uses: actions/upload-artifact@v4
with:
name: Benchmarks
path: .benchmarks/
include-hidden-files: true