|
| 1 | +name: Perf Nightly |
| 2 | + |
| 3 | +# End-to-end command perf benchmark (scripts/perf). Scheduled + manual only — perf timing on |
| 4 | +# shared CI runners is noisy, so treat this as a trend/regression signal, not absolute numbers. |
| 5 | +# Reuses the same build artifacts as the device suites: the cached iOS XCUITest runner |
| 6 | +# (setup-apple-replay, ios-runner-prebuilt cache) and the Android replay host, and runs the CLI |
| 7 | +# from source via --experimental-strip-types (no dist build), matching the replay workflows. |
| 8 | + |
| 9 | +on: |
| 10 | + schedule: |
| 11 | + - cron: "0 4 * * *" |
| 12 | + workflow_dispatch: |
| 13 | + inputs: |
| 14 | + rounds: |
| 15 | + description: "Measured rounds per command (samples)" |
| 16 | + required: false |
| 17 | + default: "5" |
| 18 | + |
| 19 | +permissions: |
| 20 | + contents: read |
| 21 | + |
| 22 | +concurrency: |
| 23 | + group: ci-${{ github.workflow }}-${{ github.ref }} |
| 24 | + cancel-in-progress: true |
| 25 | + |
| 26 | +env: |
| 27 | + AGENT_DEVICE_PERF_CLI: "--experimental-strip-types src/bin.ts" |
| 28 | + PERF_ROUNDS: ${{ github.event.inputs.rounds || '5' }} |
| 29 | + |
| 30 | +jobs: |
| 31 | + perf-ios: |
| 32 | + name: iOS Command Perf |
| 33 | + runs-on: macos-26 |
| 34 | + timeout-minutes: 80 |
| 35 | + env: |
| 36 | + IOS_RUNTIME_VERSION: "26.2" |
| 37 | + AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived |
| 38 | + steps: |
| 39 | + - name: Checkout |
| 40 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 41 | + |
| 42 | + - name: Setup toolchain |
| 43 | + uses: ./.github/actions/setup-node-pnpm |
| 44 | + |
| 45 | + - name: Setup Apple replay |
| 46 | + id: apple-replay |
| 47 | + uses: ./.github/actions/setup-apple-replay |
| 48 | + with: |
| 49 | + derived-path: ${{ env.AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH }} |
| 50 | + cache-key-prefix: ios-runner-prebuilt |
| 51 | + cache-key-suffix: -ios-${{ env.IOS_RUNTIME_VERSION }} |
| 52 | + build-command: sh ./scripts/build-xcuitest-apple.sh |
| 53 | + xcuitest-platform: ios |
| 54 | + xcuitest-destination: generic/platform=iOS Simulator |
| 55 | + clean-derived: "1" |
| 56 | + |
| 57 | + - name: Boot iOS test simulator |
| 58 | + uses: ./.github/actions/boot-ios-test-simulator |
| 59 | + with: |
| 60 | + runtime-version: ${{ env.IOS_RUNTIME_VERSION }} |
| 61 | + preferred-device-name: iPhone 17 Pro |
| 62 | + |
| 63 | + - name: Run iOS command perf benchmark |
| 64 | + run: | |
| 65 | + pnpm clean:daemon |
| 66 | + node --experimental-strip-types scripts/perf/run.ts \ |
| 67 | + --platform ios \ |
| 68 | + --device "iPhone 17 Pro" \ |
| 69 | + --n "$PERF_ROUNDS" --warmup 1 \ |
| 70 | + --out-dir "$GITHUB_WORKSPACE/perf-results" |
| 71 | +
|
| 72 | + - name: Upload iOS perf report |
| 73 | + if: always() |
| 74 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 75 | + with: |
| 76 | + name: perf-ios |
| 77 | + path: perf-results/ |
| 78 | + if-no-files-found: warn |
| 79 | + |
| 80 | + perf-android: |
| 81 | + name: Android Command Perf |
| 82 | + runs-on: ubuntu-latest |
| 83 | + timeout-minutes: 80 |
| 84 | + steps: |
| 85 | + - name: Checkout |
| 86 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 87 | + |
| 88 | + - name: Setup toolchain |
| 89 | + uses: ./.github/actions/setup-node-pnpm |
| 90 | + |
| 91 | + - name: Setup Android replay host |
| 92 | + id: android-replay-host |
| 93 | + uses: ./.github/actions/setup-android-replay-host |
| 94 | + |
| 95 | + - name: Package npm-bundled Android helpers |
| 96 | + run: | |
| 97 | + pnpm package:android-snapshot-helper:npm |
| 98 | + pnpm package:android-multitouch-helper:npm |
| 99 | +
|
| 100 | + - name: Run Android command perf benchmark |
| 101 | + uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0 |
| 102 | + with: |
| 103 | + api-level: 36 |
| 104 | + arch: x86_64 |
| 105 | + profile: pixel_7 |
| 106 | + target: google_apis_playstore |
| 107 | + emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -no-metrics |
| 108 | + script: | |
| 109 | + set -e |
| 110 | + # Disable animations up front so accessibility dumps don't time out (the harness |
| 111 | + # also runs `settings animations off`, this is belt-and-suspenders). |
| 112 | + adb -s emulator-5554 shell settings put global window_animation_scale 0 || true |
| 113 | + adb -s emulator-5554 shell settings put global transition_animation_scale 0 || true |
| 114 | + adb -s emulator-5554 shell settings put global animator_duration_scale 0 || true |
| 115 | + node --experimental-strip-types scripts/perf/run.ts \ |
| 116 | + --platform android \ |
| 117 | + --serial emulator-5554 \ |
| 118 | + --n "$PERF_ROUNDS" --warmup 1 \ |
| 119 | + --out-dir "$GITHUB_WORKSPACE/perf-results" |
| 120 | +
|
| 121 | + - name: Upload Android perf report |
| 122 | + if: always() |
| 123 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 124 | + with: |
| 125 | + name: perf-android |
| 126 | + path: perf-results/ |
| 127 | + if-no-files-found: warn |
0 commit comments