Skip to content

Commit

Permalink
Add prepare-commit script
Browse files Browse the repository at this point in the history
  • Loading branch information
curry684 committed Dec 1, 2023
1 parent 1379102 commit 3d3796a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.*.cache
/.idea
/build
/composer.lock
/tmp
/vendor
Expand Down
21 changes: 21 additions & 0 deletions bin/prepare-commit
Original file line number Diff line number Diff line change
@@ -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!"

0 comments on commit 3d3796a

Please sign in to comment.