-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
76 lines (61 loc) · 2.12 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
67
68
69
70
71
72
73
74
75
76
.PHONY: clean code-check fix-code-style test coverage help install-dependencies code-style static-analysis ci-static-analysis infection-testing pcov-disable pcov-enable update-dependencies
.DEFAULT_GOAL := test
INFECTION = ./vendor/bin/infection
PHPUNIT = ./vendor/bin/phpunit -c ./phpunit.xml
PHPSTAN = ./vendor/bin/phpstan --no-progress
PHPCS = ./vendor/bin/phpcs
PHPCBF = ./vendor/bin/phpcbf
COVCHK = ./vendor/bin/coverage-check
clean:
rm -rf ./vendor ./build
code-check:
${PHPCS}
${PHPSTAN}
fix-code-style:
${PHPCBF}
code-style:
mkdir -p build/logs/phpcs
${PHPCS}
static-analysis:
mkdir -p build/logs/phpstan
${PHPSTAN} analyse
ci-static-analysis:
mkdir -p build/logs/phpstan
${PHPSTAN} analyse --error-format=junit | tee build/logs/phpstan/junit.xml
${PHPSTAN} analyse
test:
${PHPUNIT} --no-coverage
coverage:
${PHPUNIT} && ${COVCHK} build/logs/phpunit/coverage/coverage.xml 100
infection-testing:
make coverage
cp -f build/logs/phpunit/junit.xml build/logs/phpunit/coverage/junit.xml
sudo php-ext-disable pcov
${INFECTION} --coverage=build/logs/phpunit/coverage --min-msi=84 --threads=`nproc`
sudo php-ext-enable pcov
install-dependencies:
composer install
update-dependencies:
composer update
pcov-enable:
sudo php-ext-enable pcov
pcov-disable:
sudo php-ext-disable pcov
help:
# Usage:
# make <target> [OPTION=value]
#
# Targets:
# clean Cleans the coverage and the vendor directory
# code-check For Developer machine, to check code style using phpcs & Code analysis
# code-fix For Developer machine, to fix code-style automatcially using phpcbf
# code-style Check code style using phpcs
# coverage Code Coverage display
# help You're looking at it!
# install-dependencies Install dependencies
# update-dependencies Run composer update
# static-analysis Run static analysis using phpstan
# ci-static-analysis Run static analysis using phpstan for CI only.
# test Run tests
# pcov-enable Enable pcov
# pcov-disable Disable pcov