diff --git a/.gitignore b/.gitignore index cedb71e..4291129 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ debug/ target/ schema/ +artifacts/ +artifacts-local/ + # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html Cargo.lock diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1fb8027 --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +build-opt: +# https://github.com/CosmWasm/rust-optimizer + docker run --rm -v "$(CURDIR)":/code \ + --mount type=volume,source="$$(basename "$(CURDIR)")_cache",target=/code/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/workspace-optimizer:0.15.0 + +build: +# @RUSTFLAGS='-C link-arg=-s' cargo +stable build --target wasm32-unknown-unknown --release --lib + cargo build --target wasm32-unknown-unknown --release --lib + @mkdir -p artifacts-local + @cp target/wasm32-unknown-unknown/release/*.wasm ./artifacts-local + +check: + cosmwasm-check target/wasm32-unknown-unknown/release/*.wasm + +unit-test: + cargo test --lib