diff options
| -rw-r--r-- | .github/workflows/test.yaml | 13 | ||||
| -rwxr-xr-x | examples/rust/build.sh | 2 |
2 files changed, 12 insertions, 3 deletions
diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 02d47ce..0e0c3c5 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -23,8 +23,17 @@ jobs: components: rust-src rustflags: "" target: wasm32-unknown-unknown - - name: Install Binaryen and WABT - run: sudo apt-get install -y binaryen wabt + - name: Install Binaryen + run: | + BINARYEN_VERSION=version_129 + BINARYEN_DIR="binaryen-${BINARYEN_VERSION}" + BINARYEN_ARCHIVE="${BINARYEN_DIR}-x86_64-linux.tar.gz" + curl -L "https://github.com/WebAssembly/binaryen/releases/download/${BINARYEN_VERSION}/${BINARYEN_ARCHIVE}" -o "/tmp/${BINARYEN_ARCHIVE}" + echo "50b9fa62b9abea752da92ec57e0c555fee578760cd237c40107957715d2976ba /tmp/${BINARYEN_ARCHIVE}" | sha256sum -c - + tar -xzf "/tmp/${BINARYEN_ARCHIVE}" -C /tmp + sudo install "/tmp/${BINARYEN_DIR}/bin/wasm-opt" /usr/local/bin/wasm-opt + - name: Install WABT + run: sudo apt-get install -y wabt - name: Build wasm run: ./examples/rust/build.sh - name: Save artifacts diff --git a/examples/rust/build.sh b/examples/rust/build.sh index 36f9568..db4cb43 100755 --- a/examples/rust/build.sh +++ b/examples/rust/build.sh @@ -20,7 +20,7 @@ for bin in "${bins[@]}"; do RUSTFLAGS="-Zlocation-detail=none -Zfmt-debug=none -C target-feature=$rust_features -C panic=abort" cargo build -Z build-std=std,panic_abort -Z build-std-features="optimize_for_size" --target wasm32-unknown-unknown --package rust-wasm-examples --profile=wasm --bin "$bin" cp "$out_dir/$bin.wasm" "$dest_dir/" - wasm-opt "$dest_dir/$bin.wasm" -o "$dest_dir/$bin.opt.wasm" -O3 -Oz $wasmopt_features + wasm-opt "$dest_dir/$bin.wasm" -o "$dest_dir/$bin.opt.wasm" -O3 $wasmopt_features if [[ ! " ${exclude_wat[@]} " =~ " $bin " ]]; then wasm2wat "$dest_dir/$bin.wasm" -o "$dest_dir/$bin.wat" |
