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",