#!/bin/sh set -e FEATURES= if [[ "$RUNTIME_PROFILE" == "TESTING" ]]; then FEATURES="testing_runtime" fi if [[ "$RUNTIME_PROFILE" == "STAGING" ]]; then FEATURES="staging_runtime" fi export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20 echo 'running clippy (rust linter)' # When custom build.rs triggers wasm-build-runner-impl to build we get error: # "Rust WASM toolchain not installed, please install it!" # So we skip building the WASM binary by setting BUILD_DUMMY_WASM_BINARY=1 BUILD_DUMMY_WASM_BINARY=1 cargo +nightly-2021-02-20 clippy --release --all -- -D warnings echo 'running cargo unit tests' cargo +nightly-2021-02-20 test --release --all --features ${FEATURES}