simplify composer scripts

pull/687/head
fadrian06 7 days ago
parent 3941d44c70
commit d9cf6aa9b8

@ -20,4 +20,4 @@ jobs:
extensions: curl, mbstring extensions: curl, mbstring
tools: composer:v2 tools: composer:v2
- run: composer install - run: composer install
- run: composer test-ci - run: composer test

@ -64,18 +64,30 @@
"sort-packages": true "sort-packages": true
}, },
"scripts": { "scripts": {
"test": "@php vendor/bin/phpunit", "test": "phpunit",
"test-watcher": "@php vendor/bin/phpunit-watcher watch", "test-watcher": [
"test-ci": "@php vendor/bin/phpunit", "phpunit-watcher || composer global require spatie/phpunit-watcher --dev",
"phpunit-watcher watch"
],
"test-coverage": [ "test-coverage": [
"rm -f clover.xml", "rm -f clover.xml",
"@putenv XDEBUG_MODE=coverage", "@putenv XDEBUG_MODE=coverage",
"@php vendor/bin/phpunit --coverage-html=coverage --coverage-clover=clover.xml", "phpunit --coverage-html=coverage --coverage-clover=clover.xml",
"@php vendor/bin/coverage-check clover.xml 100" "coverage-check clover.xml 100"
],
"test-server": [
"echo \"Running Test Server\"",
"@php -S localhost:8000 -t tests/server"
],
"test-server-v2": [
"echo \"Running Test Server\"",
"@php -S localhost:8000 -t tests/server-v2"
],
"test-coverage:win": [
"del clover.xml",
"phpunit --coverage-html=coverage --coverage-clover=clover.xml",
"coverage-check clover.xml 100"
], ],
"test-server": "echo \"Running Test Server\" && @php -S localhost:8000 -t tests/server/",
"test-server-v2": "echo \"Running Test Server\" && @php -S localhost:8000 -t tests/server-v2/",
"test-coverage:win": "del clover.xml && phpunit --coverage-html=coverage --coverage-clover=clover.xml && coverage-check clover.xml 100",
"test-performance": [ "test-performance": [
"echo \"Running Performance Tests...\"", "echo \"Running Performance Tests...\"",
"@php -S localhost:8077 -t tests/performance/ > /dev/null 2>&1 & echo $! > server.pid", "@php -S localhost:8077 -t tests/performance/ > /dev/null 2>&1 & echo $! > server.pid",
@ -86,12 +98,12 @@
"echo \"Performance Tests Completed.\"" "echo \"Performance Tests Completed.\""
], ],
"lint": "phpstan --no-progress --memory-limit=256M", "lint": "phpstan --no-progress --memory-limit=256M",
"beautify": "phpcbf --standard=phpcs.xml", "beautify": "phpcbf",
"phpcs": "phpcs", "phpcs": "phpcs",
"post-install-cmd": [ "post-install-cmd": [
"php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"", "@php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"",
"php -r \"if (!file_exists('phpstan.neon')) copy('phpstan.dist.neon', 'phpstan.neon');\"", "@php -r \"if (!file_exists('phpstan.neon')) copy('phpstan.dist.neon', 'phpstan.neon');\"",
"php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\"" "@php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\""
] ]
}, },
"suggest": { "suggest": {

Loading…
Cancel
Save