-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
57 lines (43 loc) · 1.25 KB
/
Makefile
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.DEFAULT_GOAL := help
COMPOSER = composer
#
### PROJECT
# --------
#
install: ## Install the project
${COMPOSER} install
.PHONY: install
reset: clean install ## Stop and start a fresh install of the project
.PHONY: reset
clean: ## Stop the project and remove generated files
rm -rf vendor
.PHONY: clean
#
### TESTS
# -------
#
test: test.composer test.phpcs test.phpunit test.behat ## Run all tests
.PHONY: test
test.composer: ## Validate composer.json
composer validate
test.phpcs: ## Run PHP CS Fixer in dry-run
composer run -- phpcs --dry-run -v
test.phpcs.fix: ## Run PHP CS Fixer and fix issues if possible
composer run -- phpcs -v
test.phpunit: ## Run PHPUnit tests
php vendor/bin/phpunit
test.behat: ## Run Behat tests
php vendor/bin/behat
hooks.install: ## Install git hooks
@cp -vp resources/git/pre-commit.sh .git/hooks/pre-commit
#
### OTHERS
# --------
#
help: SHELL=/bin/bash
help: ## Dislay this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?## .*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\n\033[33m%s\033[0m\n", $$2}'; else \
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'; fi; \
done; unset IFS;
.PHONY: help