-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (70 loc) · 2.47 KB
/
benchmark.yml
File metadata and controls
82 lines (70 loc) · 2.47 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
80
81
82
name: Competitive benchmarks
on:
release:
types: [published]
schedule:
# Every Monday at 06:00 UTC — keeps RESULTS.md at most one week stale.
- cron: "0 6 * * 1"
workflow_dispatch:
inputs:
duration:
description: "wrk duration per scenario (seconds)"
required: false
default: "10"
connections:
description: "wrk concurrent connections"
required: false
default: "64"
permissions:
contents: write
pull-requests: write
jobs:
competitive:
name: Run competitive suite + publish RESULTS.md
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install wrk
run: |
sudo apt-get update
sudo apt-get install -y wrk
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Set up Python 3.13
run: uv python install 3.13
- name: Install framework deps
# Bench extra pulls every competitor; uvicorn/granian/pydantic are
# needed for HawkAPI itself.
run: uv sync --extra dev --extra bench --extra uvicorn --extra granian --extra pydantic
- name: Run competitive benchmark suite
env:
DURATION: ${{ inputs.duration || '10' }}
CONNECTIONS: ${{ inputs.connections || '64' }}
run: ./benchmarks/competitive/run_all.sh
- name: Upload raw results + RESULTS.md
uses: actions/upload-artifact@v4
with:
name: competitive-results
path: |
benchmarks/competitive/results/
benchmarks/competitive/RESULTS.md
retention-days: 90
- name: Open PR with refreshed RESULTS.md
if: github.event_name != 'release'
uses: peter-evans/create-pull-request@v7
with:
add-paths: benchmarks/competitive/RESULTS.md
branch: chore/refresh-benchmarks
commit-message: "chore(bench): refresh competitive RESULTS.md"
title: "chore(bench): refresh competitive RESULTS.md"
body: |
Auto-generated by the `Competitive benchmarks` workflow (${{ github.event_name }} event).
wrk config: ${{ inputs.duration || '10' }}s × ${{ inputs.connections || '64' }} connections.
delete-branch: true
- name: Attach RESULTS.md to GitHub release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: benchmarks/competitive/RESULTS.md