-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy path.drone.star
61 lines (54 loc) · 1.3 KB
/
.drone.star
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
rust_version = "rust:1.81"
def main(ctx):
return [
pipeline_test_and_build(ctx)
]
def pipeline_test_and_build(ctx):
return {
"kind": "pipeline",
"type": "docker",
"name": "test_and_build",
"steps": [
step_fetch(ctx),
cargo_test_all(ctx),
cargo_lint(ctx),
cargo_wasm_build(ctx)
],
}
# Fetch the latest tags from the repository
def step_fetch(ctx):
return {
"name": "fetch",
"image": "alpine/git",
"commands": [
"git fetch --tags"
]
}
def cargo_test_all(ctx):
return {
"name": "test",
"image": rust_version,
"commands": ["cargo test --locked"]
}
def cargo_lint(ctx):
return {
"name": "lint",
"image": rust_version,
"commands": [
"rustup component add rustfmt",
"rustup component add clippy",
"cargo fmt -- --check",
"cargo clippy --all-targets -- -D warnings"
]
}
def cargo_wasm_build(ctx):
return {
"name": "wasm_build",
"image": rust_version,
"commands": [
"rustup target add wasm32-unknown-unknown",
"sh scripts/wasm_build.sh",
"cargo install cosmwasm-check",
"sh scripts/wasm_check.sh"
]
}