-
Notifications
You must be signed in to change notification settings - Fork 6
78 lines (67 loc) · 2.15 KB
/
benchmarks.yml
File metadata and controls
78 lines (67 loc) · 2.15 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
name: Benchmarks
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
--shm-size=256mb
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
python-version: "3.13"
- name: Cache uv
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-benchmark-${{ hashFiles('requirements-dev.lock') }}
restore-keys: |
${{ runner.os }}-uv-benchmark-
${{ runner.os }}-uv-
- name: Install dependencies
env:
SETUPTOOLS_SCM_WRITE_TO_SOURCE: "1"
run: |
uv venv
uv pip install -r requirements-dev.lock
uv pip install -e .
- name: Run benchmarks
env:
DATABASE_URL: postgres://postgres:postgres@127.0.0.1:5432/postgres
SECRET_KEY: for-testing-only
DJANGO_SETTINGS_MODULE: config.test_settings
RUN_BENCHMARKS: "1"
run: |
uv run pytest benchmarks/ -m benchmark --benchmark-only \
--benchmark-json=bench.json -v \
--benchmark-disable-gc
- name: Compare to baselines
if: success()
run: |
uv run python benchmarks/compare_to_baseline.py bench.json benchmarks/baselines.json
- name: Upload benchmark JSON
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: benchmark-json
path: bench.json
retention-days: 30