Skip to content

ci: fail the build when the WASM grows past its size budget - #948

Open
owjs3901 wants to merge 1 commit into
mainfrom
test/wasm-size-budget
Open

owjs3901 wants to merge 1 commit into
mainfrom
test/wasm-size-budget

Conversation

@owjs3901

Copy link
Copy Markdown
Contributor

Summary

INF-26: WASM 크기에 추적 가능한 기준선과 예산(budget)이 없던 문제를 해결합니다.

  • e2e/wasm-size/check.mjs: 빌드된 bindings/devup-ui-wasm/pkg/index_bg.wasm의 raw / gzip(-9) / brotli(-11) 크기를 측정하고, e2e/wasm-size/budget.json의 기준선(baseline)과 비교해 예산을 넘으면 실패합니다.
    • 결과 표는 GITHUB_STEP_SUMMARY에, JSON 결과는 WASM_SIZE_OUTPUT 경로에 기록되어 예산 이내의 증가도 매 실행마다 보입니다.
  • budget.json: 현재 main 소스로 빌드한 WASM(raw 7,060,664 / gzip 2,548,140 / brotli 1,783,230 바이트)을 기준선으로, 약 5.5% 여유를 둔 값(7,450,000 / 2,690,000 / 1,885,000)을 예산으로 기록했습니다. 이슈 본문의 5,387,595 바이트는 Boa 도입 이전 수치라 현재와 맞지 않습니다.
  • CI: publish 검사 job의 bun run build 직후에 Check the WASM size budget 단계와 wasm-size artifact 업로드 단계를 추가했습니다. release/publish 동작과 secret은 건드리지 않았습니다.
  • check.test.mjs(node --test)를 test:bun 스크립트에 추가했습니다. 측정, 비교, 보고서, 실패 경로, 기본 budget 파일 사용, 예산이 기준선보다 10% 이상 느슨하지 않은지를 검사합니다.
  • 예산을 올려야 할 때는 budget.json을 리뷰를 거치는 변경으로 수정합니다(실패 메시지에 안내 포함).
  • 네이티브 애드온은 플랫폼마다 크기가 달라 이번 범위에서 제외했습니다.

packages/* 변경이 없어서 changepack은 추가하지 않았습니다.

Test plan

  • node --test e2e/wasm-size/check.test.mjs (7 pass)
  • 로컬 WASM 빌드 결과로 run() 실행 시 예산 이내로 통과 확인
  • bunx prettier --single-quote --no-semi --check e2e/wasm-size
  • CI publish job의 Check the WASM size budget 단계 통과와 step summary 확인

Refs #683

🤖 Generated with Claude Code

Measure the freshly built index_bg.wasm (raw, gzip -9 and brotli -11)
in the publish check job, compare it with the baseline recorded in
e2e/wasm-size/budget.json, and fail above the approved budget. The table
goes to the step summary and a JSON artifact so growth stays visible on
every run even within the budget.

Refs #683 (INF-26)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant