From b2efb797902de5bc1dcc3d858ee26cc50ed70fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Barto=C5=A1?= Date: Tue, 26 Nov 2019 17:49:33 +0100 Subject: [PATCH] Update build --- .travis.yml | 9 +++---- Makefile | 24 ++++++++++--------- composer.json | 7 ++---- ruleset.xml | 6 ++--- .../SampleAnnotation.php | 2 +- tests/{fixtures => Fixtures}/SampleClass.php | 2 +- tests/{toolkit => Toolkit}/NeonLoader.php | 2 +- tests/{toolkit => Toolkit}/TestCase.php | 10 ++------ .../Unit/DI/AnnotationsExtensionTest.php | 6 ++--- tests/{cases => }/Unit/Reader/ReaderTest.php | 10 ++++---- 10 files changed, 35 insertions(+), 43 deletions(-) rename tests/{fixtures => Fixtures}/SampleAnnotation.php (89%) rename tests/{fixtures => Fixtures}/SampleClass.php (72%) rename tests/{toolkit => Toolkit}/NeonLoader.php (85%) rename tests/{toolkit => Toolkit}/TestCase.php (67%) rename tests/{cases => }/Unit/DI/AnnotationsExtensionTest.php (94%) rename tests/{cases => }/Unit/Reader/ReaderTest.php (82%) diff --git a/.travis.yml b/.travis.yml index 0aa14b4..2ca55a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: php + php: - 7.2 - 7.3 @@ -9,15 +10,15 @@ before_install: - phpenv config-rm xdebug.ini || return 0 # Turn off XDebug install: - - travis_retry composer install --no-progress --prefer-dist # Install dependencies + - travis_retry composer install --no-progress --prefer-dist script: - - make tests # Tests + - make tests jobs: include: - - env: title="Lowest Dependencies 7.3" - php: 7.3 + - env: title="Lowest Dependencies" + php: 7.2 install: - travis_retry composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable script: diff --git a/Makefile b/Makefile index 0130198..3b10a16 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,29 @@ .PHONY: qa lint cs csf phpstan tests coverage all: - @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | xargs + @awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m\033[0m\n\nTargets:\n"}' + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' -vendor: composer.json composer.lock - composer install +# QA -qa: lint phpstan cs +qa: lint phpstan cs ## Check code quality - coding style and static analysis -lint: vendor +lint: ## Check PHP files syntax vendor/bin/linter src tests -cs: vendor +cs: ## Check PHP files coding style vendor/bin/codesniffer src tests -csf: vendor +csf: ## Fix PHP files coding style vendor/bin/codefixer src tests -phpstan: vendor +phpstan: ## Analyse code with PHPStan vendor/bin/phpstan analyse -l max -c phpstan.neon src -tests: vendor +# Tests + +tests: ## Run all tests vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -coverage: vendor - vendor/bin/phpdbg -qrr vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -c tests/coverage.xml +coverage: ## Generate code coverage in XML format + phpdbg -qrr vendor/bin/phpunit tests --cache-result-file=tests/tmp/phpunit.cache --colors=always -c tests/coverage.xml diff --git a/composer.json b/composer.json index c7dc810..1e39254 100644 --- a/composer.json +++ b/composer.json @@ -22,9 +22,8 @@ "doctrine/cache": "^1.8.0" }, "require-dev": { - "mockery/mockery": "^1.2.2", "nettrine/cache": "^0.1.0", - "ninjify/qa": "^0.9.0", + "ninjify/qa": "^0.10.0", "phpstan/extension-installer": "^1.0", "phpstan/phpstan-deprecation-rules": "^0.11.0", "phpstan/phpstan-nette": "^0.11.0", @@ -39,9 +38,7 @@ }, "autoload-dev": { "psr-4": { - "Tests\\Cases\\": "tests/cases", - "Tests\\Fixtures\\": "tests/fixtures", - "Tests\\Toolkit\\": "tests/toolkit" + "Tests\\Nettrine\\Annotations\\": "tests" } }, "minimum-stability": "dev", diff --git a/ruleset.xml b/ruleset.xml index f6f2d13..58316af 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -6,10 +6,8 @@ diff --git a/tests/fixtures/SampleAnnotation.php b/tests/Fixtures/SampleAnnotation.php similarity index 89% rename from tests/fixtures/SampleAnnotation.php rename to tests/Fixtures/SampleAnnotation.php index 3e02c77..cf1407d 100644 --- a/tests/fixtures/SampleAnnotation.php +++ b/tests/Fixtures/SampleAnnotation.php @@ -1,6 +1,6 @@