diff --git a/.travis.yml b/.travis.yml index 98b8e01c..24ebfc96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ matrix: before_install: - echo 'extension = memcached.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo 'extension = apcu.so' >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini + - phpenv config-rm xdebug.ini || return 0 install: - composer self-update @@ -25,9 +26,10 @@ install: script: - mkdir build - - composer check + - composer ci after_success: + - rm -f build/clover.xml - vendor/bin/phpcov merge build --clover build/clover.xml - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/clover.xml diff --git a/composer.json b/composer.json index fbf77aa0..5a704aa7 100644 --- a/composer.json +++ b/composer.json @@ -93,6 +93,12 @@ "@test", "@infect" ], + "ci": [ + "@cs", + "@stan", + "@test:ci", + "@infect:ci" + ], "cs": "phpcs", "cs:fix": "phpcbf", @@ -102,30 +108,39 @@ "@test:unit", "@test:func" ], - "test:unit": "phpunit --coverage-php build/coverage-unit.cov --order-by=random", - "test:func": "phpunit -c phpunit-func.xml --coverage-php build/coverage-func.cov --order-by=random", + "test:ci": [ + "@test:unit:ci", + "@test:func" + ], + "test:unit": "phpdbg -qrr vendor/bin/phpunit --order-by=random --coverage-php build/coverage-unit.cov", + "test:unit:ci": "phpdbg -qrr vendor/bin/phpunit --order-by=random --coverage-php build/coverage-unit.cov --coverage-clover=build/clover.xml --coverage-xml=build/coverage-xml --log-junit=build/phpunit.junit.xml", + "test:func": "phpdbg -qrr vendor/bin/phpunit --order-by=random -c phpunit-func.xml --coverage-php build/coverage-func.cov", "test:pretty": [ - "@test:unit", - "@test:func", + "@test", "phpcov merge build --html build/html" ], - "test:unit:pretty": "phpunit --coverage-html build/coverage --order-by=random", + "test:unit:pretty": "phpdbg -qrr vendor/bin/phpunit --coverage-html build/coverage --order-by=random", - "infect": "infection --threads=4 --min-msi=60 --only-covered --log-verbosity=2", - "infect:show": "infection --threads=4 --min-msi=60 --only-covered --log-verbosity=2 --show-mutations" + "infect": "infection --threads=4 --min-msi=60 --log-verbosity=2 --only-covered", + "infect:ci": "infection --threads=4 --min-msi=60 --log-verbosity=2 --only-covered --coverage=build", + "infect:show": "infection --threads=4 --min-msi=60 --log-verbosity=2 --only-covered --show-mutations" }, "scripts-descriptions": { "check": "Alias for \"cs\", \"stan\", \"test\" and \"infect\"", + "ci": "Alias for \"cs\", \"stan\", \"test:ci\" and \"infect:ci\"", "cs": "Checks coding styles", "cs:fix": "Fixes coding styles, when possible", "stan": "Inspects code with phpstan", "test": "Runs all test suites", + "test:ci": "Runs all test suites, generating all needed reports and logs for CI envs", "test:unit": "Runs unit test suites", + "test:unit:ci": "Runs unit test suites, generating all needed reports and logs for CI envs", "test:func": "Runs functional test suites (covering entity repositories)", "test:pretty": "Runs all test suites and generates an HTML code coverage report", "test:unit:pretty": "Runs unit test suites and generates an HTML code coverage report", "infect": "Checks unit tests quality applying mutation testing", + "infect:ci": "Checks unit tests quality applying mutation testing with existing reports and logs", "infect:show": "Checks unit tests quality applying mutation testing and shows applied mutators" }, "config": {