build(deps-dev): bump @storybook/react-vite from 8.6.18 to 10.6.0 in /frontend #719
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: Scalability Testing | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| inputs: | |
| concurrency_limit: | |
| description: 'Max concurrency level to test' | |
| required: false | |
| default: '100' | |
| type: string | |
| jobs: | |
| # ── Scalability unit tests (always run) ─────────────────────────────────── | |
| scalability-unit: | |
| name: Scalability Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.3.0 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run scalability tests | |
| run: npx vitest run backend/tests/scalability.test.js --reporter=verbose | |
| env: | |
| NODE_ENV: test | |
| - name: Upload scalability test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scalability-results-${{ github.sha }} | |
| path: test-reports/ | |
| retention-days: 30 | |
| # ── Load-based scalability tests (main branch or manual trigger) ────────── | |
| scalability-load: | |
| name: Scalability Load Tests | |
| runs-on: ubuntu-latest | |
| if: | | |
| github.ref == 'refs/heads/main' || | |
| github.event_name == 'workflow_dispatch' | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: future_admin | |
| POSTGRES_PASSWORD: test_password | |
| POSTGRES_DB: future_test | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5433:5432 | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.3.0 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Start backend server | |
| run: | | |
| cp backend/.env.example backend/.env | |
| node backend/src/server.js & | |
| echo "SERVER_PID=$!" >> $GITHUB_ENV | |
| for i in $(seq 1 15); do | |
| curl -sf http://localhost:3001/health && break | |
| echo "Waiting for server... ($i/15)" | |
| sleep 2 | |
| done | |
| env: | |
| NODE_ENV: test | |
| DATABASE_URL: postgresql://future_admin:test_password@localhost:5433/future_test | |
| PORT: 3001 | |
| - name: Install k6 | |
| run: | | |
| sudo gpg -k | |
| sudo gpg --no-default-keyring \ | |
| --keyring /usr/share/keyrings/k6-archive-keyring.gpg \ | |
| --keyserver hkp://keyserver.ubuntu.com:80 \ | |
| --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 | |
| echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" \ | |
| | sudo tee /etc/apt/sources.list.d/k6.list | |
| sudo apt-get update | |
| sudo apt-get install k6 -y | |
| - name: Run concurrent users scalability test | |
| run: | | |
| k6 run \ | |
| --out json=backend/data/load-tests/scalability-concurrent-${{ github.sha }}.json \ | |
| backend/load-tests/k6/scenarios/concurrent-users.js | |
| env: | |
| BASE_URL: http://localhost:3001 | |
| MAX_VUS: ${{ github.event.inputs.concurrency_limit || '100' }} | |
| - name: Run API endpoint scalability test | |
| run: | | |
| k6 run \ | |
| --out json=backend/data/load-tests/scalability-endpoints-${{ github.sha }}.json \ | |
| backend/load-tests/k6/scenarios/api-endpoints.js | |
| env: | |
| BASE_URL: http://localhost:3001 | |
| - name: Stop backend server | |
| if: always() | |
| run: kill $SERVER_PID || true | |
| - name: Upload k6 scalability results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scalability-k6-results-${{ github.sha }} | |
| path: backend/data/load-tests/scalability-*.json | |
| retention-days: 30 | |
| # ── Scalability recommendations comment on PR ───────────────────────────── | |
| scalability-summary: | |
| name: Scalability Summary | |
| runs-on: ubuntu-latest | |
| needs: scalability-unit | |
| if: always() && github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
| with: | |
| script: | | |
| const status = '${{ needs.scalability-unit.result }}'; | |
| const icon = status === 'success' ? '✅' : '❌'; | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: `## Scalability Test Report\n\n${icon} **Scalability unit tests: ${status}**\n\nFull load-based scalability tests run on \`main\` branch merges. See \`scalability-results\` artifact for details.` | |
| }); |