2015-05-25 16:20:42 -07:00
|
|
|
help:
|
|
|
|
@echo "Please use \`make <target>' where <target> is one of"
|
2020-06-16 10:10:25 +01:00
|
|
|
@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"
|
2014-03-22 22:05:45 -07:00
|
|
|
|
2015-02-24 22:50:52 -08:00
|
|
|
start-server: stop-server
|
|
|
|
node tests/server.js &> /dev/null &
|
2019-12-08 20:55:00 +01:00
|
|
|
./vendor/bin/http_test_server &> /dev/null &
|
2014-03-22 22:05:45 -07:00
|
|
|
|
|
|
|
stop-server:
|
2015-02-24 22:50:52 -08:00
|
|
|
@PID=$(shell ps axo pid,command \
|
|
|
|
| grep 'tests/server.js' \
|
|
|
|
| grep -v grep \
|
|
|
|
| cut -f 1 -d " "\
|
|
|
|
) && [ -n "$$PID" ] && kill $$PID || true
|
2019-12-08 20:55:00 +01:00
|
|
|
@PID=$(shell ps axo pid,command \
|
|
|
|
| grep 'vendor/bin/http_test_server' \
|
|
|
|
| grep -v grep \
|
|
|
|
| cut -f 1 -d " "\
|
|
|
|
) && [ -n "$$PID" ] && kill $$PID || true
|
2014-03-22 22:05:45 -07:00
|
|
|
|
|
|
|
test: start-server
|
2014-09-10 17:13:42 -07:00
|
|
|
vendor/bin/phpunit
|
2014-03-22 22:05:45 -07:00
|
|
|
$(MAKE) stop-server
|
|
|
|
|
|
|
|
coverage: start-server
|
2015-03-29 11:17:00 -07:00
|
|
|
vendor/bin/phpunit --coverage-html=build/artifacts/coverage
|
2014-03-22 22:05:45 -07:00
|
|
|
$(MAKE) stop-server
|
|
|
|
|
2015-05-25 16:20:42 -07:00
|
|
|
coverage-show: view-coverage
|
|
|
|
|
2014-03-22 22:05:45 -07:00
|
|
|
view-coverage:
|
2015-03-29 11:17:00 -07:00
|
|
|
open build/artifacts/coverage/index.html
|
2014-03-22 22:05:45 -07:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -rf artifacts/*
|
|
|
|
|
2014-03-23 17:08:23 -07:00
|
|
|
docs:
|
2014-03-22 22:05:45 -07:00
|
|
|
cd docs && make html && cd ..
|
|
|
|
|
2015-05-25 16:20:42 -07:00
|
|
|
docs-show:
|
2014-03-22 22:05:45 -07:00
|
|
|
open docs/_build/html/index.html
|
|
|
|
|
2020-07-10 09:31:21 +02:00
|
|
|
static: static-phpstan static-psalm static-codestyle-check
|
|
|
|
|
|
|
|
static-psalm:
|
|
|
|
docker run --rm -it -v ${PWD}:/app -w /app vimeo/psalm-github-actions
|
2020-06-10 12:03:22 +02:00
|
|
|
|
|
|
|
static-phpstan:
|
2020-10-09 14:44:30 +01:00
|
|
|
docker run --rm -it -e REQUIRE_DEV=true -v ${PWD}:/app -w /app oskarstark/phpstan-ga:0.12.48 analyze $(PHPSTAN_PARAMS)
|
2020-06-10 12:03:22 +02:00
|
|
|
|
|
|
|
static-phpstan-update-baseline:
|
|
|
|
$(MAKE) static-phpstan PHPSTAN_PARAMS="--generate-baseline"
|
|
|
|
|
|
|
|
static-codestyle-fix:
|
2020-09-20 12:58:39 +02:00
|
|
|
docker run --rm -it -v ${PWD}:/app -w /app oskarstark/php-cs-fixer-ga:2.16.4 --diff-format udiff $(CS_PARAMS)
|
2020-06-10 12:03:22 +02:00
|
|
|
|
|
|
|
static-codestyle-check:
|
|
|
|
$(MAKE) static-codestyle-fix CS_PARAMS="--dry-run"
|
|
|
|
|
2020-06-16 10:10:25 +01:00
|
|
|
.PHONY: docs coverage-show view-coverage
|