storj/scripts/test-wasm-size.sh
Michal Niewrzal 8aa6110835 tests/backwardcompatibility: use noquic tag for release binaries
Older releases are not compiling with latest Go version if quic is used.
We need to add noquic tag to be able to compile older release with
latest Go version.

Change-Id: Id5768fcaa5c1f7cf3e6fbb633e7ca60309b7a37c
2023-02-21 13:26:46 +01: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=10900000
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)"