Skip to content

Commit 483ab7a

Browse files
committed
Makefile: modernize
1 parent 97003b0 commit 483ab7a

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

Makefile

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,34 @@
1-
.PHONY: qa lint cs csf phpstan tests coverage
2-
3-
all:
4-
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs
5-
1+
.PHONY: install
62
install:
73
composer update
84

9-
qa: lint phpstan cs
10-
11-
lint: vendor
12-
vendor/bin/linter src tests
13-
14-
cs: vendor
15-
vendor/bin/codesniffer --extensions=php src tests
16-
17-
csf: vendor
18-
vendor/bin/codefixer --extensions=php src tests
19-
20-
phpstan: vendor
21-
vendor/bin/phpstan analyse -l 8 -c phpstan.neon src
22-
23-
tests: vendor
24-
vendor/bin/phpunit
25-
26-
coverage: vendor
27-
XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=coverage.xml
5+
.PHONY: qa
6+
qa: phpstan cs
7+
8+
.PHONY: cs
9+
cs:
10+
ifdef GITHUB_ACTION
11+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr
12+
else
13+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
14+
endif
15+
16+
.PHONY: csf
17+
csf:
18+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests
19+
20+
.PHONY: phpstan
21+
phpstan:
22+
vendor/bin/phpstan analyse -c phpstan.neon
23+
24+
.PHONY: tests
25+
tests:
26+
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
27+
28+
.PHONY: coverage
29+
coverage:
30+
ifdef GITHUB_ACTION
31+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
32+
else
33+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
34+
endif

0 commit comments

Comments
 (0)