-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
58 lines (44 loc) · 1.26 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
58
SOURCE_DIR = $(shell pwd)
BIN_DIR ?= ${SOURCE_DIR}/bin
define printSection
@printf "\033[36m\n==================================================\033[0m\n"
@printf "\033[36m $1 \033[0m"
@printf "\033[36m\n==================================================\033[0m\n"
endef
.PHONY: all
all: install ci
.PHONY: ci
ci: quality test
.PHONY: install
install: clean-vendor composer-install
.PHONY: quality
quality: cs-ci phpstan
.PHONY: test
test: atoum
.PHONY: clean-vendor
clean-vendor:
$(call printSection,CLEAN VENDOR)
rm -rf ${SOURCE_DIR}/vendor
.PHONY: phpstan
phpstan: phpstan-cache-clear
$(call printSection,PHPSTAN)
${BIN_DIR}/phpstan.phar analyse --memory-limit=1G
.PHONY: phpstan-cache-clear
phpstan-cache-clear:
${BIN_DIR}/phpstan.phar clear-result-cache
composer-install:
$(call printSection,COMPOSER INSTALL)
composer --no-interaction install --ansi --no-progress --prefer-dist
atoum:
$(call printSection,TESTING)
${BIN_DIR}/atoum --no-code-coverage --verbose
.PHONY: cs
cs: composer-install
${BIN_DIR}/php-cs-fixer fix --dry-run --stop-on-violation --diff
.PHONY: cs-fix
cs-fix: composer-install
${BIN_DIR}/php-cs-fixer fix
.PHONY: cs-ci
cs-ci: composer-install
$(call printSection,PHPCS)
${BIN_DIR}/php-cs-fixer fix --dry-run --using-cache=no --verbose