ci: add WASM artifact size budget gate with regression reporting#200
Open
webdevayo wants to merge 2 commits into
Open
ci: add WASM artifact size budget gate with regression reporting#200webdevayo wants to merge 2 commits into
webdevayo wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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