-
Notifications
You must be signed in to change notification settings - Fork 360
47 lines (40 loc) · 1.17 KB
/
benchmark.yml
File metadata and controls
47 lines (40 loc) · 1.17 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
name: Benchmark Suite
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install Dependencies
run: npm ci
- name: Start API Server
run: |
npm run dev -w apps/api &
# Wait for server to start
echo "Waiting for API server..."
for i in {1..30}; do
if curl -s http://localhost:3000/health > /dev/null; then
echo "Server is up!"
break
fi
sleep 1
done
env:
STRIPE_SECRET_KEY: sk_test_benchmark
PORT: 3000
- name: Run Benchmarks (Smoke Test)
run: |
export BENCHMARK_DURATION=2
export BENCHMARK_CONNECTIONS=5
export BENCHMARK_AUTH_TOKEN=$(node -e "const jwt = require('./apps/api/node_modules/jsonwebtoken'); console.log(jwt.sign({ sub: 'admin_123', role: 'admin' }, process.env.JWT_SECRET || 'fallback_secret', { expiresIn: '1h' }))")
npm run benchmark
env:
CI: true