storj/scripts/test-wasm-size.sh
Clement Sam 5ab2e6ac19 go.mod: bump storj.io/private
Updates https://github.com/storj/storj/issues/5349

Change-Id: I5b91a8e9c28d39c6ec432992a352de08aff886d9
2023-04-05 14:46:59 +03:00

20 lines
486 B
Bash
Executable File

#!/usr/bin/env bash
set -ueo pipefail
set +x
cleanup(){
rm main.wasm
echo "cleaned up test successfully"
}
trap cleanup EXIT
cd satellite/console/wasm && pwd && GOOS=js GOARCH=wasm go build -o main.wasm .
BUILD_SIZE=$(stat -c %s main.wasm)
CURRENT_SIZE=12000000
if [ $BUILD_SIZE -gt $CURRENT_SIZE ]; then
echo "Wasm size is too big, was $CURRENT_SIZE but now it is $BUILD_SIZE"
exit 1
fi
echo "Wasm size did not increase and it is $BUILD_SIZE (limit: $CURRENT_SIZE)"