mirror of
https://github.com/callstack/agent-device.git
synced 2026-09-14 20:06:34 +08:00
8e1f8a9f8f
* perf: lazy load daemon handlers * perf: thin command metadata paths * refactor: isolate platform inventory loading * refactor: trim lazy loading cleanup * test: guard daemon routing metadata drift * ci: report startup timing with size
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: Size
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: size-${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
bundle-size:
|
|
name: Bundle Size
|
|
if: github.event.pull_request.head.repo.full_name == github.repository
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup toolchain
|
|
uses: ./.github/actions/setup-node-pnpm
|
|
|
|
- name: Preserve report script
|
|
run: cp scripts/size-report.mjs /tmp/agent-device-size-report.mjs
|
|
|
|
- name: Measure base size
|
|
run: |
|
|
git checkout --detach "${{ github.event.pull_request.base.sha }}"
|
|
pnpm install --frozen-lockfile
|
|
pnpm build
|
|
node /tmp/agent-device-size-report.mjs \
|
|
--startup-runs 7 \
|
|
--json /tmp/agent-device-size-base.json
|
|
|
|
- name: Measure PR size
|
|
run: |
|
|
git checkout --detach "${{ github.event.pull_request.head.sha }}"
|
|
pnpm install --frozen-lockfile
|
|
pnpm build
|
|
node scripts/size-report.mjs \
|
|
--compare /tmp/agent-device-size-base.json \
|
|
--startup-runs 7 \
|
|
--json .tmp/size-report.json \
|
|
--markdown .tmp/size-report.md
|
|
|
|
- name: Add job summary
|
|
run: cat .tmp/size-report.md >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Comment on PR
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
run: node scripts/size-report.mjs --post-comment .tmp/size-report.md
|