Native perf benchmarking infra for Fabric components #83
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: Perf Tests | |
| # Triggers on PRs touching source that could affect perf, | |
| # and on pushes to main/stable for baseline updates. | |
| on: | |
| pull_request: | |
| branches: [main, '*-stable'] | |
| paths: | |
| - 'vnext/**' | |
| - 'packages/**' | |
| - 'vnext/Scripts/perf/**' | |
| - '.github/workflows/perf-tests.yml' | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/e2e-test-app-fabric/test/__perf__/**' | |
| # Allow manual trigger for debugging | |
| workflow_dispatch: | |
| # Cancel in-progress runs for the same PR | |
| concurrency: | |
| group: perf-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| perf-tests: | |
| name: Component Performance Tests | |
| runs-on: windows-latest | |
| timeout-minutes: 60 | |
| permissions: | |
| contents: read | |
| actions: read | |
| steps: | |
| # ── Setup ────────────────────────────────────────────── | |
| - name: Checkout head (PR) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Need history for baseline comparison | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Install Windows SDK 10.0.22621 | |
| shell: pwsh | |
| run: | | |
| $installerUrl = "https://download.microsoft.com/download/3/b/d/3bd97f81-3f5b-4922-b86d-dc5145cd6bfe/windowssdk/winsdksetup.exe" | |
| $installerPath = "$env:TEMP\winsdksetup.exe" | |
| Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath | |
| Start-Process -FilePath $installerPath -ArgumentList '/quiet', '/norestart', '/features', '+' -Wait -NoNewWindow | |
| $sdkPath = "${env:ProgramFiles(x86)}\Windows Kits\10\Include\10.0.22621.0" | |
| if (!(Test-Path $sdkPath)) { | |
| echo "::error::Failed to install Windows SDK 10.0.22621" | |
| exit 1 | |
| } | |
| - name: Build perf-testing package | |
| run: yarn workspace @react-native-windows/perf-testing build | |
| - name: Enable Developer Mode | |
| shell: pwsh | |
| run: reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v AllowDevelopmentWithoutDevLicense /d 1 | |
| # ── Build & Deploy RNTesterApp-Fabric (for native perf tests) ── | |
| - name: Build and deploy RNTesterApp-Fabric | |
| working-directory: packages/e2e-test-app-fabric | |
| run: yarn windows --release --no-launch --logging | |
| # ── Run Tests ────────────────────────────────────────── | |
| - name: Run perf tests | |
| id: perf-run | |
| working-directory: packages/e2e-test-app-fabric | |
| env: | |
| CI: 'true' | |
| RN_TARGET_PLATFORM: windows | |
| run: yarn perf:ci | |
| continue-on-error: true # Don't fail here — let comparison decide | |
| - name: Run native perf tests | |
| id: native-perf-run | |
| working-directory: packages/e2e-test-app-fabric | |
| env: | |
| CI: 'true' | |
| RN_TARGET_PLATFORM: windows | |
| run: yarn perf:native:ci | |
| continue-on-error: true | |
| # ── Compare & Report ─────────────────────────────────── | |
| - name: Compare against baselines | |
| id: compare | |
| working-directory: packages/e2e-test-app-fabric | |
| run: yarn perf:ci:compare | |
| continue-on-error: true | |
| - name: Save PR number | |
| if: github.event_name == 'pull_request' | |
| run: echo "${{ github.event.pull_request.number }}" > packages/e2e-test-app-fabric/.perf-results/pr-number.txt | |
| - name: Upload perf results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: perf-results | |
| path: | | |
| packages/e2e-test-app-fabric/.perf-results/ | |
| packages/e2e-test-app-fabric/.native-perf-results/ | |
| packages/e2e-test-app-fabric/test/__perf__/**/__perf_snapshots__/ | |
| packages/e2e-test-app-fabric/test/__native_perf__/**/__perf_snapshots__/ | |
| retention-days: 30 | |
| # ── Status Gate ──────────────────────────────────────── | |
| - name: Check for regressions | |
| if: steps.compare.outcome == 'failure' | |
| run: | | |
| echo "::error::Performance regressions detected. See PR comment for details." | |
| exit 1 |