diff --git a/.gitignore b/.gitignore index 0242f3bb..cd939ebc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.*.cache /.idea +/build /composer.lock /tmp /vendor diff --git a/bin/prepare-commit b/bin/prepare-commit new file mode 100755 index 00000000..2bdf5f9d --- /dev/null +++ b/bin/prepare-commit @@ -0,0 +1,21 @@ +#!/bin/sh +set -e +cd $(dirname $0)/.. + +export APP_ENV=test +export APP_DEBUG=1 +export XDEBUG_MODE=coverage + +vendor/bin/php-cs-fixer fix +vendor/bin/phpstan + +# Clear cache and quarantine manually to avoid locking up with corrupted container +rm -rf tests/fixture/var/cache/test +php -d "zend.assertions=1" vendor/bin/phpunit --testdox --coverage-text \ + --coverage-xml=build/coverage/coverage-xml --log-junit=build/coverage/junit.xml + +# Run with lower MSI in diff-filter mode as it doesn't include coverage from other tests +#vendor/bin/infection --threads=max --git-diff-filter=AM --min-msi=80 --min-covered-msi=80 \ +# --coverage=build/coverage + +echo "All good, ready for commit!"