Merge branch 'new-instrumentation' of github.com:AikidoSec/node-RASP … #3688
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 📊 Benchmark | |
| on: | |
| push: {} | |
| workflow_call: {} | |
| jobs: | |
| benchmark: | |
| runs-on: ubuntu-latest | |
| services: | |
| mongodb: | |
| image: mongo:5 | |
| env: | |
| "MONGO_INITDB_ROOT_USERNAME": "root" | |
| "MONGO_INITDB_ROOT_PASSWORD": "password" | |
| ports: | |
| - 27017:27017 | |
| postgres: | |
| image: postgres:14-alpine | |
| env: | |
| "POSTGRES_PASSWORD": "password" | |
| "POSTGRES_USER": "root" | |
| "POSTGRES_DB": "main_db" | |
| ports: | |
| - "27016:5432" | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| node-version: [20.x, 24.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| cache-dependency-path: "**/package-lock.json" | |
| - name: Install K6 | |
| uses: grafana/setup-k6-action@ffe7d7290dfa715e48c2ccc924d068444c94bde2 # v1 | |
| - name: Install wrk | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y wrk | |
| - name: Set up Rust | |
| run: | | |
| rustup toolchain install stable | |
| rustup default stable | |
| cargo install wasm-pack | |
| - run: npm install | |
| - run: npm run build | |
| - name: Run NoSQL Injection Benchmark | |
| run: cd benchmarks/nosql-injection && AIKIDO_CI=true node benchmark.js | |
| - name: Run SQL Injection Benchmark | |
| run: cd benchmarks/sql-injection && node benchmark.js | |
| - name: Run shell injection Benchmark | |
| run: cd benchmarks/shell-injection && node benchmark.js | |
| - name: Run Hono with Postgres Benchmark | |
| run: cd benchmarks/hono-pg && node benchmark.js | |
| - name: Run API Discovery Benchmark | |
| run: cd benchmarks/api-discovery && node benchmark.js | |
| - name: Run Express Benchmark | |
| # Skip on Node 24.x because benchmark currently fails. | |
| # Big performance improve in comparison to older Node.js versions, but higher difference between usage with and without Zen | |
| if: matrix.node-version != '24.x' | |
| run: cd benchmarks/express && node benchmark.js | |
| - name: Check Rate Limiter memory usage | |
| run: cd benchmarks/rate-limiting && node --expose-gc memory.js |