2021-12-06 11:15:33 +03:00
|
|
|
DOCKER_CONTAINER = "test_instance"
|
2021-06-05 14:44:51 +03:00
|
|
|
|
2021-06-05 14:26:35 +03:00
|
|
|
default:
|
|
|
|
cargo build --release
|
|
|
|
|
2021-06-09 17:11:58 +03:00
|
|
|
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
|
|
|
|
|
2023-10-16 20:38:29 +03:00
|
|
|
docker: docker
|
2021-12-16 12:21:51 +03:00
|
|
|
docker push mcaptcha/cache:0.1.0-beta
|
2022-08-05 17:04:56 +03:00
|
|
|
docker push mcaptcha/cache:latest
|
2021-06-05 14:26:35 +03:00
|
|
|
|
|
|
|
docker-build:
|
2023-10-16 20:38:29 +03:00
|
|
|
docker buildx build -t mcaptcha/cache:0.1.0-beta -t mcaptcha/cache:latest . --load
|
2021-06-05 14:26:35 +03:00
|
|
|
|
|
|
|
docker-run:
|
2021-12-16 12:21:51 +03:00
|
|
|
docker run -d --name=$(DOCKER_CONTAINER) \
|
2021-06-05 14:26:35 +03:00
|
|
|
--publish 6379:6379 \
|
2021-12-06 11:15:33 +03:00
|
|
|
mcaptcha/cache:latest
|
2021-06-05 14:26:35 +03:00
|
|
|
|
2021-06-09 17:11:58 +03:00
|
|
|
docker-stop:
|
|
|
|
docker stop $(DOCKER_CONTAINER) || true
|
|
|
|
docker rm $(DOCKER_CONTAINER)
|
2021-12-06 10:46:18 +03:00
|
|
|
|
2021-06-09 17:11:58 +03:00
|
|
|
env:
|
2021-06-05 14:26:35 +03:00
|
|
|
./scripts/setup.sh
|
2021-12-06 10:26:35 +03:00
|
|
|
@-virtualenv venv || true
|
|
|
|
@-pip install codespell
|
2021-06-05 14:26:35 +03:00
|
|
|
|
2021-08-31 17:10:32 +03:00
|
|
|
test:
|
2021-06-09 17:11:58 +03:00
|
|
|
./tests/test.py
|
2023-10-17 12:08:03 +03:00
|
|
|
#@ . venv/bin/activate && ./scripts/spellcheck.sh -c
|
|
|
|
# cargo test --all --all-features --no-fail-fast
|
2021-06-05 14:26:35 +03:00
|
|
|
|
|
|
|
xml-test-coverage:
|
|
|
|
cargo tarpaulin -t 1200 --out Xml --all --all-features --no-fail-fast
|
|
|
|
|
2021-06-09 17:11:58 +03:00
|
|
|
run-redis:
|
|
|
|
redis-server --loadmodule ./target/release/libcache.so &
|
2021-06-06 20:42:27 +03:00
|
|
|
|
2021-06-09 17:11:58 +03:00
|
|
|
stop-redis:
|
|
|
|
killall redis-server
|
2021-06-05 14:26:35 +03:00
|
|
|
|
2021-12-06 10:26:35 +03:00
|
|
|
lint: ## Lint codebase
|
|
|
|
@ . venv/bin/activate && ./scripts/spellcheck.sh -w
|
|
|
|
cargo fmt -v --all -- --emit files
|
|
|
|
cargo clippy --workspace --tests --all-features
|
2021-06-09 17:11:58 +03:00
|
|
|
|
2021-12-06 10:26:35 +03:00
|
|
|
help:
|
2021-06-09 17:11:58 +03:00
|
|
|
@echo ' bench - run benchmarks'
|
|
|
|
@echo ' clean - drop builds and environments'
|
|
|
|
@echo ' coverage - build test coverage in HTML format'
|
|
|
|
@echo ' doc - build documentation'
|
2021-06-05 14:26:35 +03:00
|
|
|
@echo ' docker-build - build docker image'
|
|
|
|
@echo ' docker-run - run docker container'
|
|
|
|
@echo ' docker-stop - stop docker container'
|
2021-06-09 17:11:58 +03:00
|
|
|
@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'
|
2021-06-05 14:26:35 +03:00
|
|
|
@echo ' xml-coverage - build test coverage in XML for upload to codecov'
|
|
|
|
@echo ''
|