-
-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (69 loc) · 2.23 KB
/
Copy pathpython-bench-regression.yml
File metadata and controls
79 lines (69 loc) · 2.23 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI / Benchmarks / Regression
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: bench-pr-${{ github.ref }}
cancel-in-progress: true
jobs:
head:
name: "Bench head"
uses: ./.github/workflows/python-bench.yml
with:
suffix: head
quick: true
repeats: "5"
warmup_loops: "1"
artifact_name: pathable-bench-pr-head
compare:
name: "Bench compare (PR vs baseline)"
runs-on: ubuntu-latest
needs: head
env:
BENCH_TOLERANCE: "0.20"
steps:
- uses: actions/checkout@v6
- name: Download head benchmark results
uses: actions/download-artifact@v8
with:
name: pathable-bench-pr-head
path: reports
- name: Restore baseline cache
id: baseline-cache
uses: actions/cache/restore@v5
with:
path: |
reports/bench-parse.baseline.json
reports/bench-lookup.baseline.json
key: bench-baseline-py3.12-${{ github.event.pull_request.base.sha }}
restore-keys: |
bench-baseline-py3.12-
- name: Ensure baseline exists
shell: bash
run: |
set -euo pipefail
if [[ -f reports/bench-parse.baseline.json && -f reports/bench-lookup.baseline.json ]]; then
exit 0
fi
echo "Baseline benchmark cache not found for this repository." >&2
echo "Run the baseline workflow on master at least once to populate cache." >&2
exit 1
- name: Compare parse benchmark
shell: bash
run: |
python tests/benchmarks/compare_results.py \
--baseline reports/bench-parse.baseline.json \
--candidate reports/bench-parse.head.json \
--tolerance "$BENCH_TOLERANCE"
- name: Compare lookup benchmark
shell: bash
run: |
python tests/benchmarks/compare_results.py \
--baseline reports/bench-lookup.baseline.json \
--candidate reports/bench-lookup.head.json \
--tolerance "$BENCH_TOLERANCE"
- name: Upload comparison inputs
uses: actions/upload-artifact@v7
with:
name: pathable-bench-pr-results
path: reports/bench-*.json