forked from z22092/taskiq-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.46 KB
/
performance.yml
File metadata and controls
57 lines (49 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
57
name: Performance Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * 0' # Weekly on Sunday at 2 AM
jobs:
benchmark:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: taskiq_benchmark
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies with asyncpg
run: uv sync --dev --group asyncpg
- name: Run performance tests
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/taskiq_benchmark
run: |
uv run pytest tests/ -v -m "performance" --tb=short --durations=10
- name: Performance benchmark with asyncpg
env:
TEST_DATABASE_URL: postgresql://postgres:postgres@localhost:5432/taskiq_benchmark
TEST_DRIVER: asyncpg
run: |
# Run a simple benchmark script if available
if [ -f "benchmarks/run_benchmark.py" ]; then
uv run python benchmarks/run_benchmark.py
fi