mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
9d6154eecb
A3: perf-nightly writes a report and compares nothing, so it structurally cannot catch a regression. iOS wall-clock medians swing up to +122% night-to-night at n=5 (a comparator would print noise), no doc/issue reads the report, and the iOS job holds a macOS runner ~22min nightly. Parked to workflow_dispatch following the #1781 A1 pattern (replays-manual.yml); it declares no gate-manifest check, so no declarations.ts change is needed. `pnpm perf` / scripts/perf are untouched. A5: the "Enforce changed-line coverage gate" step ran `if: always()`, so when the preceding "Run coverage" step failed, lcov.info was never written and this step failed too with "no lcov report" -- a cascade double-red, not a coverage verdict. 16 of the last 17 red instances (60d) were this cascade; the step now runs only when Run coverage succeeded.
121 lines
4.3 KiB
YAML
121 lines
4.3 KiB
YAML
name: Perf Nightly
|
|
|
|
# Parked to workflow_dispatch by #1781 A3: it only writes a report and compares nothing, so it
|
|
# structurally cannot catch a regression, and iOS wall-clock medians swing up to +122%
|
|
# night-to-night at n=5 with no consumer reading the report. `pnpm perf` / scripts/perf are
|
|
# unaffected — still runnable on demand. Un-park once a comparison step with multi-night
|
|
# smoothing (someone reading it) exists, or a perf arc needs nightly data.
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
rounds:
|
|
description: 'Measured rounds per command (samples)'
|
|
required: false
|
|
default: '5'
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
AGENT_DEVICE_PERF_CLI: '--experimental-strip-types src/bin.ts'
|
|
PERF_ROUNDS: ${{ github.event.inputs.rounds || '5' }}
|
|
|
|
jobs:
|
|
perf-ios:
|
|
name: iOS Command Perf
|
|
runs-on: macos-26
|
|
timeout-minutes: 80
|
|
env:
|
|
IOS_RUNTIME_VERSION: '26.2'
|
|
AGENT_DEVICE_STATE_DIR: ${{ github.workspace }}/.tmp/agent-device-state
|
|
AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH: ${{ github.workspace }}/.tmp/ios-runner-derived
|
|
AGENT_DEVICE_IOS_PREPARE_TIMEOUT_MS: '420000'
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Setup toolchain
|
|
uses: ./.github/actions/setup-node-pnpm
|
|
|
|
- name: Restore and build iOS XCTest runner
|
|
uses: ./.github/actions/setup-apple-runner-build
|
|
with:
|
|
derived-path: ${{ env.AGENT_DEVICE_IOS_RUNNER_DERIVED_PATH }}
|
|
cache-key-prefix: ios-runner-prebuilt
|
|
cache-key-suffix: -ios-${{ env.IOS_RUNTIME_VERSION }}
|
|
gate: swift-runner-ios
|
|
xcuitest-platform: ios
|
|
xcuitest-destination: generic/platform=iOS Simulator
|
|
|
|
- name: Boot iOS test simulator
|
|
uses: ./.github/actions/boot-ios-test-simulator
|
|
with:
|
|
runtime-version: ${{ env.IOS_RUNTIME_VERSION }}
|
|
preferred-device-name: iPhone 17 Pro
|
|
|
|
- name: Preflight iOS runner through public CLI
|
|
run: |
|
|
pnpm clean:daemon
|
|
node --experimental-strip-types src/bin.ts prepare ios-runner --platform ios --timeout "$AGENT_DEVICE_IOS_PREPARE_TIMEOUT_MS"
|
|
pnpm clean:daemon
|
|
|
|
- name: Run iOS command perf benchmark
|
|
run: |
|
|
pnpm perf --platform ios \
|
|
--device "iPhone 17 Pro" \
|
|
--n "$PERF_ROUNDS" --warmup 1 \
|
|
--out-dir "$GITHUB_WORKSPACE/perf-results"
|
|
|
|
- name: Upload iOS perf report
|
|
if: always()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: perf-ios
|
|
path: perf-results/
|
|
if-no-files-found: warn
|
|
|
|
perf-android:
|
|
name: Android Command Perf
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 80
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
|
|
- name: Setup toolchain
|
|
uses: ./.github/actions/setup-node-pnpm
|
|
|
|
- name: Setup Android replay host
|
|
id: android-replay-host
|
|
uses: ./.github/actions/setup-android-replay-host
|
|
with:
|
|
package-helpers: 'true'
|
|
|
|
- name: Run Android command perf benchmark
|
|
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # v2.35.0
|
|
with:
|
|
api-level: 36
|
|
arch: x86_64
|
|
profile: pixel_7
|
|
target: google_apis_playstore
|
|
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -no-metrics
|
|
script: >-
|
|
set -e;
|
|
adb -s emulator-5554 shell settings put global window_animation_scale 0 || true;
|
|
adb -s emulator-5554 shell settings put global transition_animation_scale 0 || true;
|
|
adb -s emulator-5554 shell settings put global animator_duration_scale 0 || true;
|
|
pnpm perf --platform android --serial emulator-5554 --n "$PERF_ROUNDS" --warmup 1 --out-dir "$GITHUB_WORKSPACE/perf-results"
|
|
|
|
- name: Upload Android perf report
|
|
if: always()
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: perf-android
|
|
path: perf-results/
|
|
if-no-files-found: warn
|