-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
112 lines (89 loc) · 2.77 KB
/
Makefile
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
109
110
111
112
.PHONY: check
check:
cargo check --workspace
.PHONY: checkall
checkall:
cargo check --workspace --all-targets
cargo check --workspace --all-targets --no-default-features --features mock-deps
.PHONY: build
build:
cargo build --workspace
.PHONY: buildall
buildall:
cargo build --workspace --all-targets
cargo build --workspace --all-targets --no-default-features --features mock-deps
.PHONY: clean
clean:
cargo clean
.PHONY: test
test: TEST = ''
test:
cargo test --workspace --lib --verbose -- $(TEST)
.PHONY: integrationtests
integrationtests: FILE = *
integrationtests: TEST = ''
integrationtests:
cargo test --no-default-features --features mock-deps --workspace --test '$(FILE)' -- --include-ignored $(TEST)
.PHONY: e2etests
e2etests: FILE = *
e2etests: TEST = ''
e2etests:
cargo test --workspace --test '$(FILE)' -- $(TEST)
.PHONY: testregisternode
testregisternode:
cargo test --test register_node_test -- --ignored --nocapture
.PHONY: monitortest
monitortest:
cargo +nightly test --test monitoring_test -- --test-threads=1 --ignored -Z unstable-options --report-time --format json > test.json
.PHONY: testall
testall: test integrationtests
.PHONY: fmt
fmt:
cargo fmt --all
.PHONY: fmt-check
fmt-check:
cargo fmt --all -- --check
.PHONY: clippy
clippy:
cargo clippy --all --tests --examples -- -D warnings
.PHONY: udeps
udeps:
cargo +nightly udeps
# Check that we stick to `mod tests {` style.
.PHONY: check-mod-test
check-mod-test:
! grep --recursive --include="*.rs" "mod test " *
.PHONY: check-udl
check-udl:
! grep $$'\t' src/lipalightninglib.udl
.PHONY: doc
doc:
cargo doc --no-deps
# Quick tests to run before creating a PR.
.PHONY: pr
pr: fmt buildall test clippy check-mod-test check-udl doc
.PHONY: bump-wild
bump-wild:
@newest_tag=$$(curl -s "https://api.github.com/repos/getlipa/wild/tags" | jq -r '.[0].name'); \
cargo_toml_files=$$(echo './Cargo.toml' ; find ./mock/wild/ -type f -name 'Cargo.toml'); \
if command -v gsed > /dev/null; then \
echo "$$cargo_toml_files" | xargs gsed -i "s/\(git = \"https:\/\/github.com\/getlipa\/wild\",\).*\(tag = \"[^\"]*\"\)/\1 tag = \"$$newest_tag\"/g"; \
else \
echo "$$cargo_toml_files" | xargs sed -i "s/\(git = \"https:\/\/github.com\/getlipa\/wild\",\).*\(tag = \"[^\"]*\"\)/\1 tag = \"$$newest_tag\"/g"; \
fi; \
echo "Bumped wild to $$newest_tag"; \
.PHONY: run-node
run-node: ARGS =
run-node:
cargo run --example node -- $(ARGS)
.PHONY: run-node-mocked
run-node-mocked: ARGS =
run-node-mocked:
cargo run --example node --no-default-features --features mock-deps -- $(ARGS)
.PHONY: run-parser-demo
run-parser-demo:
cargo run --package parser --example demo
.PHONY: run-notification-handler
run-notification-handler: ARGS =
run-notification-handler:
cargo run --example notification_handler -- $(ARGS)