-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
51 lines (39 loc) · 1.22 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
KUBE_API_VERSION?=1.30
.PHONY: build
build:
K8S_OPENAPI_ENABLED_VERSION=$(KUBE_API_VERSION) cargo build --release
.PHONY: fmt
fmt:
K8S_OPENAPI_ENABLED_VERSION=$(KUBE_API_VERSION) cargo fmt --all -- --check
.PHONY: lint
lint:
K8S_OPENAPI_ENABLED_VERSION=$(KUBE_API_VERSION) cargo clippy --workspace -- -D warnings
.PHONY: check
check:
K8S_OPENAPI_ENABLED_VERSION=$(KUBE_API_VERSION) cargo check
.PHONY: test
test: fmt lint
cargo test --workspace
.PHONY: unit-tests
unit-tests: fmt lint
cargo test --workspace --lib
.PHONY: integration-tests
integration-tests: fmt lint
cargo test --test '*'
.PHONY: coverage
coverage: coverage-unit-tests coverage-integration-tests
.PHONY: coverage-unit-tests
coverage-unit-tests:
# use --skip-clean to not recompile on CI if not needed
cargo tarpaulin --verbose --skip-clean --engine=llvm \
--lib --bin --follow-exec \
--out xml --out html --output-dir coverage/unit-tests
.PHONY: coverage-integration-tests
coverage-integration-tests:
# use --skip-clean to not recompile on CI if not needed
cargo tarpaulin --verbose --skip-clean --engine=llvm \
--test integration_test --follow-exec \
--out xml --out html --output-dir coverage/integration-tests
.PHONY: clean
clean:
cargo clean