Skip to content

Commit adcbdda

Browse files
authored
perf: speed up unit tests and streamline checks (#1488)
* perf: speed up unit tests and streamline checks * fix: validate canonical packaging workflows
1 parent 9e75eab commit adcbdda

31 files changed

Lines changed: 916 additions & 544 deletions
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Package Smoke
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'package.json'
7+
- 'pnpm-lock.yaml'
8+
- 'tsdown.config.ts'
9+
- 'scripts/build-android-helper.sh'
10+
- 'scripts/build-xcuitest-apple.sh'
11+
- 'scripts/package-android-helper.sh'
12+
- 'scripts/package-apple-runner-source.mjs'
13+
- 'scripts/patch-xcuitest-runner-icon.ts'
14+
- 'scripts/sync-mcp-metadata.mjs'
15+
- 'scripts/write-xcuitest-cache-metadata.mjs'
16+
- 'apple/macos-helper/**'
17+
- 'apple/runner/**'
18+
- 'android/ime-helper/**'
19+
- 'android/snapshot-helper/**'
20+
- '.github/actions/setup-node-pnpm/**'
21+
- '.github/workflows/package-smoke.yml'
22+
push:
23+
branches:
24+
- main
25+
paths:
26+
- 'package.json'
27+
- 'pnpm-lock.yaml'
28+
- 'tsdown.config.ts'
29+
- 'scripts/build-android-helper.sh'
30+
- 'scripts/build-xcuitest-apple.sh'
31+
- 'scripts/package-android-helper.sh'
32+
- 'scripts/package-apple-runner-source.mjs'
33+
- 'scripts/patch-xcuitest-runner-icon.ts'
34+
- 'scripts/sync-mcp-metadata.mjs'
35+
- 'scripts/write-xcuitest-cache-metadata.mjs'
36+
- 'apple/macos-helper/**'
37+
- 'apple/runner/**'
38+
- 'android/ime-helper/**'
39+
- 'android/snapshot-helper/**'
40+
- '.github/actions/setup-node-pnpm/**'
41+
- '.github/workflows/package-smoke.yml'
42+
43+
permissions:
44+
contents: read
45+
46+
concurrency:
47+
group: package-smoke-${{ github.ref }}
48+
cancel-in-progress: true
49+
50+
jobs:
51+
package:
52+
name: Build npm package
53+
runs-on: macos-26
54+
timeout-minutes: 30
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
58+
59+
- name: Setup toolchain
60+
uses: ./.github/actions/setup-node-pnpm
61+
62+
- name: Build complete npm package
63+
run: pnpm prepack

‎.github/workflows/perf-nightly.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ jobs:
6868
6969
- name: Run iOS command perf benchmark
7070
run: |
71-
pnpm perf \
72-
--platform ios \
71+
pnpm perf --platform ios \
7372
--device "iPhone 17 Pro" \
7473
--n "$PERF_ROUNDS" --warmup 1 \
7574
--out-dir "$GITHUB_WORKSPACE/perf-results"
@@ -112,7 +111,7 @@ jobs:
112111
adb -s emulator-5554 shell settings put global window_animation_scale 0 || true;
113112
adb -s emulator-5554 shell settings put global transition_animation_scale 0 || true;
114113
adb -s emulator-5554 shell settings put global animator_duration_scale 0 || true;
115-
pnpm perf:android --serial emulator-5554 --n "$PERF_ROUNDS" --warmup 1 --out-dir "$GITHUB_WORKSPACE/perf-results"
114+
pnpm perf --platform android --serial emulator-5554 --n "$PERF_ROUNDS" --warmup 1 --out-dir "$GITHUB_WORKSPACE/perf-results"
116115
117116
- name: Upload Android perf report
118117
if: always()

‎.github/workflows/test-app-build-cache.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
- name: Setup test app dependencies
4646
uses: ./.github/actions/setup-test-app-dependencies
4747

48+
- name: Typecheck test app
49+
run: pnpm test-app:typecheck
50+
4851
- name: Resolve native fingerprint
4952
id: fingerprint
5053
env:

‎AGENTS.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ prose in this repo, including this file.
4141
shipped before this rule.
4242
- Unreleased API surface dies free. Before treating a field as wire-compat, check
4343
`git tag --contains <commit>`; if it never shipped, delete it now.
44-
- Push only behind `&&`-chained gates: `format:check && typecheck && lint && vitest && git push`. A
45-
push that can run after a failed gate eventually will.
44+
- Push only behind an `&&`-chained affected gate:
45+
`pnpm check:affected --run && git push`. A push that can run after a failed gate eventually will;
46+
GitHub remains authoritative for reported device/toolchain lanes.
4647

4748
## Derived registries — read the declaration site, not prose
4849

@@ -159,9 +160,10 @@ one question so `rg` → read-whole-file stays one cheap bounded read.
159160
the only exclusion list is `.oxfmtrc.json` `ignorePatterns` — Markdown, the Maestro conformance
160161
corpus, and generated baselines. Run `pnpm format`, never `oxfmt <path>`: a path argument
161162
reformats a subset and hides whatever else drifted.
162-
- Before pushing, the aggregate is **`pnpm check`** (`check:tooling && check:fallow &&
163-
check:unit`). `pnpm check:tooling` is a *subset*: it stops before the Fallow audit, so dead
164-
exports and complexity findings your diff introduces still fail CI after it passes clean.
163+
- Before pushing, default to **`pnpm check:affected --run`**. It selects the relevant local gates and
164+
reports native/device checks left to GitHub. Use **`pnpm check`**
165+
(`check:tooling && check:fallow && check:unit`) for broad refactors or an explicitly requested full
166+
deterministic core gate. Neither command claims to reproduce every GitHub job.
165167
Fallow's baselines are keyed by path, so a change that RENAMES a file must move that file's
166168
entry in `fallow-baselines/health.json` — regenerating the baselines would silently accept
167169
every other outstanding finding too.

0 commit comments

Comments
 (0)