-
Notifications
You must be signed in to change notification settings - Fork 360
50 lines (42 loc) · 1.24 KB
/
api-benchmark-smoke.yml
File metadata and controls
50 lines (42 loc) · 1.24 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
name: API benchmark smoke
on:
pull_request:
paths:
- "apps/api/**"
- "benchmarks/**"
- "package.json"
- "package-lock.json"
- ".github/workflows/api-benchmark-smoke.yml"
jobs:
benchmark-smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm test
- name: Start API
run: |
JWT_SECRET=benchmark-secret PORT=4000 npm run dev -w apps/api > /tmp/freelanceflow-api.log 2>&1 &
echo $! > /tmp/freelanceflow-api.pid
for attempt in $(seq 1 30); do
if curl -fsS http://127.0.0.1:4000/health > /dev/null 2>&1; then
echo "API ready"
exit 0
fi
sleep 1
done
echo "API failed to start:"
cat /tmp/freelanceflow-api.log
exit 1
- name: Run smoke benchmark
env:
BENCHMARK_TARGET: http://127.0.0.1:4000
BENCHMARK_JWT_SECRET: benchmark-secret
BENCHMARK_CONNECTIONS: 1
BENCHMARK_REQUESTS_PER_ENDPOINT: 2
BENCHMARK_FAIL_ON_THRESHOLD: "true"
run: npm run benchmark:smoke