-
Notifications
You must be signed in to change notification settings - Fork 19
/
Makefile.toml
108 lines (91 loc) · 3.23 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
101
102
103
104
105
106
107
108
extend = [
{ path = "schema.Makefile.toml" },
{ path = "coverage_grcov.Makefile.toml" }
]
[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.16.0"
# Use rust version from rust-optimizer Dockerfile (see https://github.com/CosmWasm/optimizer/blob/v0.16.0/Dockerfile#L1)
# to be sure that we compile / test against the same version
RUST_VERSION = "1.78.0"
[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-stable-for-scripts]
env = { RUST_VERSION = "1.76.0" }
run_task = "install-stable"
[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.unit-test]
toolchain = "${RUST_VERSION}"
command = "cargo"
args = ["test", "--locked", "--workspace", "--exclude", "mars-integration-tests", "--exclude", "mars-swapper-astroport", "--exclude", "mars-oracle-wasm", "--exclude", "mars-swapper-osmosis", "--exclude", "mars-zapper-osmosis"]
[tasks.integration-test]
toolchain = "${RUST_VERSION}"
command = "cargo"
args = ["test", "--locked", "-p", "mars-integration-tests", "-p", "mars-swapper-astroport", "-p", "mars-oracle-wasm", "-p", "mars-swapper-osmosis", "-p", "mars-zapper-osmosis", "--test", "*"]
[tasks.fmt]
toolchain = "nightly"
command = "cargo"
args = ["fmt", "--all"]
[tasks.fmt-check]
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",
]