-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.toml
100 lines (82 loc) · 2.64 KB
/
Makefile.toml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[config]
default_to_workspace = false
[env]
# Directory with wasm files used by integration tests (another directory can be used instead, for example 'artifacts' from rust-optimizer)
ARTIFACTS_DIR_PATH = "target/wasm32-unknown-unknown/release"
# If you bump this version, verify RUST_VERSION correctness
RUST_OPTIMIZER_VERSION = "0.14.0"
# Use rust version from rust-optimizer Dockerfile (see https://github.com/CosmWasm/rust-optimizer/blob/main/Dockerfile#L1)
# to be sure that we compile / test against the same version
RUST_VERSION = "1.69.0"
[tasks.add-contract]
script = '''
python3 "$(pwd)"/template/add_template.py
'''
[tasks.install-stable]
script = '''
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain ${RUST_VERSION}
rustup target add wasm32-unknown-unknown --toolchain ${RUST_VERSION}
rustup component add rustfmt --toolchain ${RUST_VERSION}
rustup component add clippy --toolchain ${RUST_VERSION}
rustup component add llvm-tools-preview --toolchain ${RUST_VERSION}
'''
[tasks.install-nightly]
script = '''
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain nightly
rustup target add wasm32-unknown-unknown --toolchain nightly
rustup component add rustfmt --toolchain nightly
'''
[tasks.build]
toolchain = "${RUST_VERSION}"
command = "cargo"
args = ["build", "--release", "--target", "wasm32-unknown-unknown", "--locked"]
[tasks.rust-optimizer]
script = """
if [[ $(arch) == "arm64" ]]; then
image="cosmwasm/workspace-optimizer-arm64:${RUST_OPTIMIZER_VERSION}"
else
image="cosmwasm/workspace-optimizer:${RUST_OPTIMIZER_VERSION}"
fi
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
${image}
"""
[tasks.test]
toolchain = "${RUST_VERSION}"
command = "cargo"
args = ["test", "--locked"]
[tasks.fmt]
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all", "--check"]
[tasks.clippy]
toolchain = "${RUST_VERSION}"
command = "cargo"
args = ["clippy", "--tests", "--", "-D", "warnings"]
[tasks.audit]
toolchain = "${RUST_VERSION}"
command = "cargo"
args = ["audit"]
[tasks.coverage-html]
alias = "coverage-grcov-html"
[tasks.coverage-lcov]
alias = "coverage-grcov-lcov"
[tasks.all-actions]
dependencies = [
"install-stable",
"install-nightly",
"fmt",
"clippy",
"build",
"test",
"audit",
"generate-all-schemas",
"rust-optimizer",
]
[tasks.deploy]
command = "cargo"
args = ["run", "--bin", "deploy", "${@}"]
[tasks.generate-data]
command = "cargo"
args = ["run", "--bin", "generate-data", "${@}"]