diff --git a/.gitattributes b/.gitattributes index 8020b21..02aba1e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,7 +3,8 @@ /.gitattributes export-ignore /.gitignore export-ignore /.travis.yml export-ignore -/bob_config.php export-ignore +/behat.yml export-ignore /CHANGELOG.md export-ignore +/Makefile export-ignore /phpunit.xml export-ignore /README.md export-ignore diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ad42a3e --- /dev/null +++ b/Makefile @@ -0,0 +1,41 @@ +BEHAT:=$(shell command -v behat 2> /dev/null) +PHPCS:=$(shell command -v phpcs 2> /dev/null) +COMPOSER_CMD:=$(shell command -v composer 2> /dev/null) + +.DEFAULT_GOAL=all + +.PHONY: all +all: test phpcs + +.PHONY: clean +clean: + rm -rf vendor + rm -f composer.lock + +.PHONY: test +test: phpunit behat + +.PHONY: phpunit +phpunit: composer.lock + vendor/bin/phpunit + +.PHONY: behat +behat: composer.lock +ifndef BEHAT + $(error "behat is not available, please install to continue") +endif + behat --stop-on-failure + +.PHONY: phpcs +phpcs: composer.lock +ifndef PHPCS + $(error "phpcs is not available, please install to continue") +endif + phpcs src --standard=PSR2 + phpcs tests --standard=PSR2 + +composer.lock: composer.json +ifndef COMPOSER_CMD + $(error "composer is not available, please install to continue") +endif + composer install