-
Notifications
You must be signed in to change notification settings - Fork 1.7k
89 lines (75 loc) · 2.33 KB
/
codspeed-benchmarks.yaml
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
80
81
82
83
84
85
86
87
88
89
name: CodSpeed Benchmarks
env:
PY_COLORS: 1
on:
pull_request:
paths:
- .github/workflows/benchmarks.yaml
- .github/workflows/python-tests.yaml
- "src/prefect/**/*.py"
- requirements.txt
- requirements-dev.txt
- setup.cfg
- Dockerfile
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
run-benchmarks:
name: Benchmark
# Runs with ephemeral API and SQLite database right now
runs-on:
group: oss-larger-runners
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Docker Buildx
if: ${{ matrix.build-docker-images }}
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:v0.12.5
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: UV Cache
uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: uvcache-${{ runner.os }}-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('requirements-client.txt', 'requirements.txt', 'requirements-dev.txt') }}
- name: Install packages
run: |
python -m pip install -U uv
uv pip install --upgrade --system .[dev] pytest-codspeed
uv pip uninstall --system pytest-benchmark
- name: Start server
run: |
PREFECT_HOME=$(pwd) prefect server start&
PREFECT_API_URL="http://127.0.0.1:4200/api" ./scripts/wait-for-server.py
# TODO: Replace `wait-for-server` with dedicated command
# https://github.com/PrefectHQ/prefect/issues/6990
- name: Run benchmarks
uses: CodSpeedHQ/action@v3
env:
PREFECT_API_URL: "http://127.0.0.1:4200/api"
with:
run: >
pytest
benches/bench_import.py
benches/bench_tasks.py
benches/bench_flows.py::bench_flow_decorator
benches/bench_flows.py::bench_flow_call
--codspeed
--numprocesses auto
--dist worksteal
-vv