Files
mistralai-client-rs/Makefile
2024-03-05 00:50:21 +01:00

42 lines
896 B
Makefile

SHELL := /bin/bash
.PHONY: test
define source_env_if_not_ci
@if [ -z "$${CI}" ]; then \
if [ -f ./.env ]; then \
source ./.env; \
else \
echo "No .env file found"; \
exit 1; \
fi \
fi
endef
define RELEASE_TEMPLATE
conventional-changelog -p conventionalcommits -i ./CHANGELOG.md -s
git add .
git commit -m "docs(changelog): update"
git push origin HEAD
cargo release $(1) --execute
git push origin HEAD --tags
endef
release-patch:
$(call RELEASE_TEMPLATE,patch)
release-minor:
$(call RELEASE_TEMPLATE,minor)
release-major:
$(call RELEASE_TEMPLATE,major)
test:
@$(source_env_if_not_ci) && cargo test --nocapture --no-fail-fast
test-cover:
@$(source_env_if_not_ci) && cargo tarpaulin --frozen --out Xml
test-doc:
@$(source_env_if_not_ci) && cargo test --doc --nocapture --no-fail-fast
test-watch:
@$(source_env_if_not_ci) && cargo watch -x "test -- --nocapture"