From 4d9da05b6633d438a7867406a3149a4902374190 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 4 Jul 2026 14:01:47 +0000 Subject: [PATCH] ci: drop duplicate unit-test run, cache Size base dist, typecheck with tsgo Three measured dev-loop/CI cuts, no signal loss: - typecheck now runs tsgo (already trusted for declaration emit by the tsdown build): 21.7s -> 5.3s locally, and check:tooling drops to ~18s total. tsc stays available as typecheck:tsc; verified tsgo fails on type errors and respects noUnusedLocals. - remove the Unit Tests CI job: Coverage runs the same unit + provider-integration suites under coverage thresholds, so the job reran ~64s of tests every PR for no extra signal. - Size workflow: skip docs-only paths (same paths-ignore as CI) and cache the base commit's dist keyed on base SHA, since dist is fully determined by that commit. Startup medians are still measured fresh on the same runner so the base/PR startup comparison stays same-machine; the cache is saved immediately after the base measurement so the PR build never poisons it. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01FqeW8sA2ZnvnftdvpCqFMS --- .github/workflows/ci.yml | 16 ++-------------- .github/workflows/size.yml | 30 +++++++++++++++++++++++++++++- package.json | 3 ++- 3 files changed, 33 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b85bab53..aeba2eaf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,21 +126,9 @@ jobs: FALLOW_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} run: pnpm check:fallow --base "$FALLOW_BASE" - unit: - name: Unit Tests - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Setup toolchain - uses: ./.github/actions/setup-node-pnpm - - - name: Run unit tests - run: pnpm test:unit - coverage: + # Runs the full unit + provider-integration suites under coverage with + # thresholds, so a separate unit-tests job would rerun the same tests. name: Coverage runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/.github/workflows/size.yml b/.github/workflows/size.yml index aa12dfae8..ab8054a02 100644 --- a/.github/workflows/size.yml +++ b/.github/workflows/size.yml @@ -2,6 +2,14 @@ name: Size on: pull_request: + paths-ignore: + - "docs/**" + - "website/**" + - "README.md" + - ".github/actions/build-docs/action.yml" + - ".github/workflows/deploy.yml" + - ".github/workflows/pr-preview.yml" + - ".github/workflows/pr-preview-cleanup.yml" permissions: contents: read @@ -29,15 +37,35 @@ jobs: - name: Preserve report script run: cp scripts/size-report.mjs /tmp/agent-device-size-report.mjs + # dist is fully determined by the base commit, so reuse it across PR runs + # against the same base. Startup medians are still measured fresh on this + # runner so the base/PR comparison stays same-machine. + - name: Restore base dist cache + id: base-dist-cache + uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3 + with: + path: dist + key: size-base-dist-${{ github.event.pull_request.base.sha }} + - name: Measure base size run: | git checkout --detach "${{ github.event.pull_request.base.sha }}" pnpm install --frozen-lockfile - pnpm build + if [ "${{ steps.base-dist-cache.outputs.cache-hit }}" != "true" ]; then + pnpm build + fi node /tmp/agent-device-size-report.mjs \ --startup-runs 7 \ --json /tmp/agent-device-size-base.json + # Save immediately: the job-end dist belongs to the PR head, not the base. + - name: Save base dist cache + if: steps.base-dist-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.3 + with: + path: dist + key: size-base-dist-${{ github.event.pull_request.base.sha }} + - name: Measure PR size run: | git checkout --detach "${{ github.event.pull_request.head.sha }}" diff --git a/package.json b/package.json index a3c58ff46..13f1dc925 100644 --- a/package.json +++ b/package.json @@ -117,7 +117,8 @@ "check:unit": "pnpm test:unit && pnpm test:smoke", "check": "pnpm check:tooling && pnpm check:fallow && pnpm check:unit", "prepack": "pnpm check:mcp-metadata && pnpm build:all && pnpm package:android-snapshot-helper:npm && pnpm package:android-multitouch-helper:npm", - "typecheck": "tsc -p tsconfig.json", + "typecheck": "tsgo -p tsconfig.json", + "typecheck:tsc": "tsc -p tsconfig.json", "test-app:install": "pnpm install --dir examples/test-app --ignore-workspace", "test-app:start": "pnpm --dir examples/test-app start", "test-app:ios": "pnpm --dir examples/test-app ios",