Keep CI green by default, always upload profiling artifacts, and gate regressions when thresholds are exceeded.
Use these full files directly:
templates/starter-repo/.github/workflows/performance.ymltemplates/orbit/.github/workflows/orbit-performance.yml
Copy commands from repo root:
# Starter
mkdir -p /path/to/target-repo/.github/workflows
cp templates/starter-repo/.github/workflows/performance.yml \
/path/to/target-repo/.github/workflows/performance.yml
# Orbit
cp templates/orbit/.github/workflows/orbit-performance.yml \
/path/to/target-repo/.github/workflows/orbit-performance.yml- Stages
profiles/baseline.jsonandprofiles/current_profile.json. - Optionally captures live profile when vars exist:
STYLUS_TRACE_RPC_URLSTYLUS_TRACE_TX_HASH
- Runs
stylus-trace diff. - Uploads
artifacts/asstylus-trace-artifacts.
- Requires:
- Variable
ORBIT_RPC_URL - Variable
ORBIT_TX_HASH - Secret
ORBIT_CHAIN_ID
- Variable
- Captures profile from Orbit RPC transaction hash.
- Diffs against committed baseline.
- Uploads
artifacts/asorbit-stylus-trace-artifacts.
- Global gate:
stylus-trace diff baseline.json current_profile.json --threshold-percent 3.0
- Gas-only gate:
stylus-trace diff baseline.json current_profile.json --gas-threshold 1.5
- HostIO-only gate:
stylus-trace diff baseline.json current_profile.json --hostio-threshold 5.0
- Cache Cargo index and target with
Swatinem/rust-cache@v2. - Keep baseline profiles committed to repo for deterministic first runs.
artifacts/capture/current_profile.jsonartifacts/diff/diff_report.jsonartifacts/diff/diff.svg
- Full command file:
docs/template-validation.md