-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 933 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (23 loc) · 933 Bytes
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
# Slimmer — Makefile
.PHONY: help build test test-filter shell clean
# Defaults
COMPOSE := docker compose
SERVICE := test
FILTER ?=
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
# Docker image
build: ## Build (or rebuild) the Docker image
$(COMPOSE) build --pull $(SERVICE)
# Test targets
test: ## Run the full test suite (builds image if needed)
$(COMPOSE) run --rm $(SERVICE)
test-filter: ## Run tests matching FILTER=<pattern> (e.g. make test-filter FILTER=PdfOptimizer)
$(COMPOSE) run --rm $(SERVICE) \
vendor/bin/pest --configuration phpunit.xml --filter "$(FILTER)"
# Dev helpers
shell: ## Open a bash shell inside the test container
$(COMPOSE) run --rm --entrypoint /bin/sh $(SERVICE)
clean: ## Remove containers, volumes, and the built image
$(COMPOSE) down --volumes --rmi local