SHELL := /bin/bash
PKG_NAME := soothe-client
PKG_VERSION := $(shell sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
.DEFAULT_GOAL := help
.PHONY: help fmt fmt-check clippy test test-unit test-integration test-examples \
check verify build clean doc publish-dry
help:
@echo "$(PKG_NAME)@$(PKG_VERSION)"
@echo ""
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
fmt:
cargo fmt
fmt-check:
cargo fmt --check
clippy:
cargo clippy --all-targets --features image -- -D warnings
test-unit:
cargo test --lib --test unit_api --test appkit_unit --features image
test: test-unit
test-integration:
SOOTHE_INTEGRATION=1 cargo test --test integration --features image -- --nocapture --test-threads=1
test-examples:
@for ex in 01_hello 02_stream_turn 03_text_completion 04_multi_turn 05_pool_service 06_jobs; do \
echo "=== $$ex ==="; \
cargo run --example $$ex || exit 1; \
done
check: fmt-check clippy test-unit
verify: check build
build:
cargo build --release --features image
doc:
cargo doc --no-deps
clean:
cargo clean
publish-dry:
cargo publish --dry-run