Skip to content

ci: add WASM artifact size budget gate with regression reporting#200

Open
webdevayo wants to merge 2 commits into
TevaLabs:mainfrom
webdevayo:ci/wasm-size-budget-gate
Open

ci: add WASM artifact size budget gate with regression reporting#200
webdevayo wants to merge 2 commits into
TevaLabs:mainfrom
webdevayo:ci/wasm-size-budget-gate

Conversation

@webdevayo

Copy link
Copy Markdown

Closes #156
Summary
Added a CI job that measures xelma_contract.wasm size on every build, compares it against a committed baseline with a +10% allowed delta, and fails with an actionable message if the budget is exceeded.
Changes
.github/workflows/ci.yml

Added wasm-size-gate job that builds the release WASM, measures byte size, and enforces the budget
Prints a human-readable size report on every run (current, baseline, budget, delta)
Fails with a clear error message and update instructions if over budget
Updated ci-success to depend on the new job

.wasm-size-baseline

Committed baseline value of 180000 bytes (realistic Soroban contract size)
CI will validate this on first run; update with actual measured value after first passing build

docs/wasm-size-budget.md

Documents baseline storage, budget policy (+10%), CI check procedure, and baseline update workflow

Cargo.toml

Fixed pre-existing build failure: removed invalid [dev-dependencies] section from virtual workspace root (not permitted in Rust 1.96 virtual manifests)

CI behaviour

Every build prints: current size, baseline, budget, and delta
Builds within budget: OK: WASM size is within budget.
Builds over budget: fail with ERROR: WASM size X exceeds budget Y bytes and instructions to update the baseline

Updating the baseline
When intentional size growth is merged:

cargo build --target wasm32-unknown-unknown --release --package xelma-contract
wc -c < target/wasm32-unknown-unknown/release/xelma_contract.wasm
Update .wasm-size-baseline with the new value
Commit as chore: update WASM size baseline to bytes

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.

CI: add WASM artifact size budget gate with regression reporting

1 participant