Skip to content

Commit c979f17

Browse files
authored
feat: add performance profiling setup (#514)
- Add performance:benchmark script to package.json - Add dedicated performance CI job that runs the benchmark - Wire performance job into merge-protection and ci-success gates Closes #83
1 parent b26b4a4 commit c979f17

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,36 @@ jobs:
474474
name: bundle-size-report-${{ github.sha }}
475475
path: bundle-size-report.json
476476

477+
# ─────────────────────────────────────────────────────────
478+
# Performance Monitoring
479+
# ─────────────────────────────────────────────────────────
480+
performance:
481+
name: Performance Budget Check
482+
runs-on: ubuntu-latest
483+
steps:
484+
- name: Checkout code
485+
uses: actions/checkout@v4
486+
487+
- name: Setup Node.js
488+
uses: actions/setup-node@v4
489+
with:
490+
node-version: ${{ env.NODE_VERSION }}
491+
cache: 'npm'
492+
493+
- name: Cache node modules
494+
uses: actions/cache@v4
495+
id: cache-node-modules
496+
with:
497+
path: node_modules
498+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
499+
500+
- name: Install dependencies
501+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
502+
run: npm ci --legacy-peer-deps
503+
504+
- name: Run performance benchmark
505+
run: npm run performance:benchmark
506+
477507
# ─────────────────────────────────────────────────────────
478508
# Merge Protection (only on PRs)
479509
# ─────────────────────────────────────────────────────────
@@ -495,6 +525,7 @@ jobs:
495525
rust-build,
496526
load-test,
497527
bundle-size,
528+
performance,
498529
]
499530
steps:
500531
- name: All checks passed
@@ -521,6 +552,7 @@ jobs:
521552
rust-build,
522553
load-test,
523554
bundle-size,
555+
performance,
524556
]
525557
steps:
526558
- name: Check for failures
@@ -539,7 +571,8 @@ jobs:
539571
[ "${{ needs.rust-tests.result }}" != "success" ] || \
540572
[ "${{ needs.rust-build.result }}" != "success" ] || \
541573
[ "${{ needs.load-test.result }}" != "success" ] || \
542-
[ "${{ needs.bundle-size.result }}" != "success" ]; then
574+
[ "${{ needs.bundle-size.result }}" != "success" ] || \
575+
[ "${{ needs.performance.result }}" != "success" ]; then
543576
echo "One or more CI checks failed"
544577
exit 1
545578
fi

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"test": "jest --passWithNoTests",
2020
"test:coverage": "jest --coverage",
2121
"performance:ci": "node scripts/check-performance-budget.js",
22+
"performance:benchmark": "node scripts/check-performance-budget.js",
2223
"mutation:test": "npx --yes @stryker-mutator/core@9.0.0 run",
2324
"build": "expo export",
2425
"build:android": "expo run:android --variant release",

0 commit comments

Comments
 (0)