forked from guzzle/guzzle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (56 loc) · 2.5 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
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " start-server to start the test server"
@echo " stop-server to stop the test server"
@echo " test to perform unit tests. Provide TEST to perform a specific test."
@echo " coverage to perform unit tests with code coverage. Provide TEST to perform a specific test."
@echo " coverage-show to show the code coverage report"
@echo " clean to remove build artifacts"
@echo " docs to build the Sphinx docs"
@echo " docs-show to view the Sphinx docs"
@echo " static to run phpstan and php-cs-fixer on the codebase"
@echo " static-phpstan to run phpstan on the codebase"
@echo " static-phpstan-update-baseline to regenerate the phpstan baseline file"
@echo " static-codestyle-fix to run php-cs-fixer on the codebase, writing the changes"
@echo " static-codestyle-check to run php-cs-fixer on the codebase"
start-server: stop-server
node tests/server.js &> /dev/null &
./vendor/bin/http_test_server &> /dev/null &
stop-server:
@PID=$(shell ps axo pid,command \
| grep 'tests/server.js' \
| grep -v grep \
| cut -f 1 -d " "\
) && [ -n "$$PID" ] && kill $$PID || true
@PID=$(shell ps axo pid,command \
| grep 'vendor/bin/http_test_server' \
| grep -v grep \
| cut -f 1 -d " "\
) && [ -n "$$PID" ] && kill $$PID || true
test: start-server
vendor/bin/phpunit
$(MAKE) stop-server
coverage: start-server
vendor/bin/phpunit --coverage-html=build/artifacts/coverage
$(MAKE) stop-server
coverage-show: view-coverage
view-coverage:
open build/artifacts/coverage/index.html
clean:
rm -rf artifacts/*
docs:
cd docs && make html && cd ..
docs-show:
open docs/_build/html/index.html
static: static-phpstan static-psalm static-codestyle-check
static-psalm:
docker run --rm -it -v ${PWD}:/app -w /app vimeo/psalm-github-actions
static-phpstan:
docker run --rm -it -e REQUIRE_DEV=true -v ${PWD}:/app -w /app oskarstark/phpstan-ga:0.12.48 analyze $(PHPSTAN_PARAMS)
static-phpstan-update-baseline:
$(MAKE) static-phpstan PHPSTAN_PARAMS="--generate-baseline"
static-codestyle-fix:
docker run --rm -it -v ${PWD}:/app -w /app oskarstark/php-cs-fixer-ga:2.16.4 --diff-format udiff $(CS_PARAMS)
static-codestyle-check:
$(MAKE) static-codestyle-fix CS_PARAMS="--dry-run"
.PHONY: docs coverage-show view-coverage