.PHONY: help build test test-unit test-integration test-integration-up test-integration-down test-integration-wait pull-ollama-models clippy fmt fmt-check doc clean
OGL_URL ?= http://localhost:8000
DOCKER_COMPOSE ?= docker-compose
COMPOSE := $(DOCKER_COMPOSE) -f compose.test.yml --env-file .env.test
help:
@awk 'BEGIN{FS=":.*##";printf "Usage: make <cible>\n\nCibles:\n"} /^[a-zA-Z_-]+:.*##/{printf " \033[36m%-28s\033[0m %s\n",$$1,$$2}' $(MAKEFILE_LIST)
build:
cargo build
test-unit:
cargo test --lib
test-integration: test-integration-up test-integration-wait
OGL_TEST_URL=$(OGL_URL) cargo test --tests -- --ignored
test-integration-up:
$(COMPOSE) up -d
test-integration-down:
$(COMPOSE) down
test-integration-wait:
@echo "Attente de OGL sur $(OGL_URL)/v1/models..."
@for i in $$(seq 1 60); do \
if curl -fsSm 2 $(OGL_URL)/v1/models > /dev/null 2>&1; then \
echo "OGL prêt ($$i*2s)"; exit 0; \
fi; \
sleep 2; \
done; \
echo "Timeout après 120s"; exit 1
pull-ollama-models:
ollama pull qwen3-coder:30b
ollama pull nomic-embed-text
clippy:
cargo clippy --all-targets -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt --check
doc:
cargo doc --no-deps
clean:
cargo clean