Skip to content

Commit 3096799

Browse files
Roman3349f3l1x
authored andcommitted
Modernize Makefile
Signed-off-by: Roman Ondráček <[email protected]>
1 parent 5aa5851 commit 3096799

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

Makefile

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
1-
.PHONY: qa lint cs csf phpstan tests coverage
1+
.PHONY: install qa cs csf phpstan tests coverage
22

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
3+
install:
4+
composer update
55

6-
vendor: composer.json composer.lock
7-
composer install
6+
qa: phpstan cs
87

9-
qa: lint phpstan cs
8+
cs:
9+
ifdef GITHUB_ACTION
10+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp -q --report=checkstyle src tests | cs2pr
11+
else
12+
vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
13+
endif
1014

11-
lint: vendor
12-
vendor/bin/linter src tests
15+
csf:
16+
vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests
1317

14-
cs: vendor
15-
vendor/bin/codesniffer src tests
18+
phpstan:
19+
vendor/bin/phpstan analyse -c phpstan.neon
1620

17-
csf: vendor
18-
vendor/bin/codefixer src tests
21+
tests:
22+
vendor/bin/tester -s -p php --colors 1 -C tests/Cases
1923

20-
phpstan: vendor
21-
vendor/bin/phpstan analyse -l max -c phpstan.neon src
22-
23-
tests: vendor
24-
vendor/bin/tester -s -p php --colors 1 -C tests/cases
25-
26-
coverage: vendor
27-
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage ./coverage.xml --coverage-src ./src tests/cases
24+
coverage:
25+
ifdef GITHUB_ACTION
26+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases
27+
else
28+
vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.html --coverage-src src tests/Cases
29+
endif

0 commit comments

Comments
 (0)