-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
53 lines (45 loc) · 1.46 KB
/
taskfile.yml
File metadata and controls
53 lines (45 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
version: '3'
tasks:
build:
desc: Build the WASM contract
cmds:
- cargo +nightly build --release --target wasm32-unknown-unknown -p simple-contract
- mkdir -p artifacts
- cp target/wasm32-unknown-unknown/release/simple-contract.wasm artifacts/
- wasm-strip artifacts/simple-contract.wasm
optimize:
desc: Optimize the WASM contract using docker
cmds:
- docker run --rm -v "$(pwd)":/code --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry cosmwasm/optimizer:0.17.0
check:
desc: Check the contract for errors
cmds:
- cargo check --target wasm32-unknown-unknown -p simple-contract --release
- ~/.cargo/bin/cosmwasm-check artifacts/simple-contract.wasm
all:
desc: build, optimize and check
cmds:
- task: build
- task: optimize
- task: check
- ls -l artifacts/*
test:
desc: Run tests
cmds:
- cargo test
clean:
desc: Clean build artifacts
cmds:
- cargo clean
- rm -rf artifacts/
install-target:
desc: Install the wasm32-unknown-unknown target
cmds:
- rustup target add wasm32-unknown-unknown
setup:
desc: Setup the environment for building WASM contracts
cmds:
- task: install-target
- cargo install cargo-generate --features vendored-openssl
- cargo install cosmwasm-check
- cargo install cargo-bloat