forked from chubbyphp-legacy/chubbyphp-socket-server-mock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (53 loc) · 1.88 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
59
60
61
62
63
64
65
66
.PHONY: clean code-check fix-code-style code-style dev-static-analysis static-analysis infection-testing test coverage install-dependencies update-dependencies help
.DEFAULT_GOAL := test
INFECTION = ./vendor/bin/infection
PHPUNIT = ./vendor/bin/phpunit -c ./phpunit.xml
PHPSTAN = ./vendor/bin/phpstan analyse
PHPCS = ./vendor/bin/phpcs --extensions=php
PHPCBF = ./vendor/bin/phpcbf --standard=PSR12
clean:
rm -rf ./vendor
code-check:
${PHPCS}
${PHPSTAN}
fix-code-style:
${PHPCBF} ./src ./tests
${PHPCSF} . --rules=no_unused_imports
code-style:
mkdir -p build/logs/phpcs
${PHPCS}
dev-static-analysis:
mkdir -p build/logs/phpstan
${PHPSTAN}
static-analysis:
mkdir -p build/logs/phpstan
${PHPSTAN} --no-progress --error-format=junit | tee build/logs/phpstan/junit.xml
infection-testing:
make coverage
cp -f build/logs/phpunit/junit.xml build/logs/phpunit/phpunit.junit.xml
${INFECTION} --coverage=build/logs/phpunit --min-msi=84 --threads=`nproc`
test:
${PHPUNIT} --no-coverage
coverage:
${PHPUNIT} && ./vendor/bin/coverage-check build/logs/phpunit/clover.xml 100
install-dependencies:
composer install
update-dependencies:
composer update
help:
# Usage:
# make <target> [OPTION=value]
#
# Targets:
# clean Cleans the coverage and the vendor directory
# code-check Check code style using phpcs & Code analysis
# code-style Check code style using phpcs
# coverage Code Coverage display
# fix-code-style PHP Code fix using phpcbf
# help You're looking at it!
# infection-testing Run infection/mutation testing
# install-dependencies Install dependencies
# update-dependencies Run composer update
# static-analysis Run static analysis using phpstan (for CI)
# dev-static-analysis Run static analysis using phpstan
# test Run tests