forked from mCaptcha/cache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (58 loc) · 2.04 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
DOCKER_CONTAINER = "test_instance"
default:
cargo build --release
bench:
./scripts/bench.sh
clean:
cargo clean
coverage:
cargo tarpaulin -t 1200 --out Html --all --all-features --no-fail-fast
dev:
cargo build
doc:
cargo doc --no-deps --workspace --all-features --document-private-items
docker:
docker build -t mcaptcha/cache:0.1.0-beta -t mcaptcha/cache:latest .
docker push mcaptcha/cache:0.1.0-beta
docker push mcaptcha/cache:latest
docker-build:
docker build -t mcaptcha/cache:0.1.0-beta -t mcaptcha/cache:latest .
docker-run:
docker run -d --name=$(DOCKER_CONTAINER) \
--publish 6379:6379 \
mcaptcha/cache:latest
docker-stop:
docker stop $(DOCKER_CONTAINER) || true
docker rm $(DOCKER_CONTAINER)
env:
./scripts/setup.sh
@-virtualenv venv || true
@-pip install codespell
test:
@ . venv/bin/activate && ./scripts/spellcheck.sh -c
cargo test --all --all-features --no-fail-fast
./tests/test.py
xml-test-coverage:
cargo tarpaulin -t 1200 --out Xml --all --all-features --no-fail-fast
run-redis:
redis-server --loadmodule ./target/release/libcache.so &
stop-redis:
killall redis-server
lint: ## Lint codebase
@ . venv/bin/activate && ./scripts/spellcheck.sh -w
cargo fmt -v --all -- --emit files
cargo clippy --workspace --tests --all-features
help:
@echo ' bench - run benchmarks'
@echo ' clean - drop builds and environments'
@echo ' coverage - build test coverage in HTML format'
@echo ' doc - build documentation'
@echo ' docker-build - build docker image'
@echo ' docker-run - run docker container'
@echo ' docker-stop - stop docker container'
@echo ' env - setup dev env'
@echo ' run-redis - load and run redis on local machine'
@echo ' stop-redis - kill local redis instance'
@echo ' test - run unit and integration tests'
@echo ' xml-coverage - build test coverage in XML for upload to codecov'
@echo ''