-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (36 loc) · 1.38 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
MYSQL_PORT=32123
MYSQL_PING=mysqladmin ping -h127.0.0.1 -P$(MYSQL_PORT) -uroot -ptesting --silent 2>/dev/null
ifndef VERBOSE
.SILENT:
endif
all: static test
test: test-unit
ci: static test-unit-ci
.PHONY: test-unit
test-unit:
vendor/bin/phpunit --testsuite Unit --order-by=random --prepend test/xdebug-filter.php
.PHONY: test-unit
test-unit-ci:
vendor/bin/phpunit --testsuite Unit --order-by=random --prepend test/xdebug-filter.php --color=never --coverage-text
.PHONY: test-unit-ci
test-integration:
docker-compose up -d db
echo -n "waiting for mysql container"
while ! $(MYSQL_PING); do sleep 1 && echo -n '.'; done
DB_PORT=$(MYSQL_PORT) vendor/bin/phpunit --testsuite Integration --order-by=random --prepend test/xdebug-filter.php
docker-compose stop -t 0 db
docker-compose rm -f db
.PHONY: test-integration
static:
echo "Linting files"
find src -name '*.php' -print0 | xargs -0 -n1 php -l 1>/dev/null
find src -name '*.phtml' -print0 | xargs -0 -n1 php -l 1>/dev/null
find test -name '*.php' -print0 | xargs -0 -n1 php -l 1>/dev/null
echo "Running PHP-CS-Fixer"
vendor/bin/php-cs-fixer fix src --dry-run --show-progress=none --quiet
vendor/bin/php-cs-fixer fix test/Unit --dry-run --show-progress=none --quiet
echo "Running MessDetector"
vendor/bin/phpmd src text phpmd.xml
echo "Running PHPStan"
vendor/bin/phpstan analyse --no-progress --configuration=phpstan.neon
.PHONY: static