From 78ab16a59d607551a04496ba6ddbc46fe1f140c5 Mon Sep 17 00:00:00 2001 From: brunota20 Date: Wed, 17 Jun 2026 09:21:21 -0300 Subject: [PATCH] ci: build all production module .wasm targets via matrix (COW-1066) Previously `build-module` only compiled `-p example`, leaving the 5 production modules (twap-monitor, ethflow-watcher, price-alert, balance-tracker, stop-loss) without CI coverage on the wasm side. A wasm-build regression (broken cowprotocol feature flag, alloy version drift, no_std assumption broken) would ship to upstream review without CI catching it. This converts the job to a `matrix.module` strategy listing all 6 modules (example kept for parity) and adds a tiny "report wasm size" step so reviewers can spot size regressions in the Actions log. `fail-fast: false` so one broken module does not mask others. Verified locally: - example builds clean - twap-monitor builds clean - ethflow-watcher builds clean - price-alert builds clean - balance-tracker builds clean - stop-loss builds clean Linear: COW-1066. --- .github/workflows/ci.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99de175..3bbd544 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,8 +56,18 @@ jobs: - run: cargo test --workspace --all-features --no-fail-fast build-module: - name: build example module + name: build ${{ matrix.module }} (wasm32-wasip2) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + module: + - example + - twap-monitor + - ethflow-watcher + - price-alert + - balance-tracker + - stop-loss steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master 2026-03-27 @@ -65,4 +75,12 @@ jobs: toolchain: nightly targets: wasm32-wasip2 - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 - - run: cargo build -p example --target wasm32-wasip2 --release + - run: cargo build -p ${{ matrix.module }} --target wasm32-wasip2 --release + - name: report wasm size + run: | + artifact_name=$(echo "${{ matrix.module }}" | tr '-' '_') + wasm_path="target/wasm32-wasip2/release/${artifact_name}.wasm" + if [ -f "$wasm_path" ]; then + size=$(wc -c < "$wasm_path") + echo "${{ matrix.module }} .wasm size: ${size} bytes" + fi