Skip to content

Commit

Permalink
add composer scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Péter Báthory committed Apr 8, 2020
1 parent cbc6ded commit b68e65f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/vendor
/tests/coverage/
/build
composer.lock
composer.phar
.phpunit.result.cache

# JetBrains (PhpStorm)
.idea/
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ install:

script:
- mkdir -p build/logs
- GEOS_DISABLED=1 vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- cd tests
- php test.php
- php performanceTest.php
- cd ..
- composer cs
- composer stan
- composer unit-clover
- composer test-input
- composer performance

# run tests on the following versions
php:
Expand Down
25 changes: 25 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,30 @@
},
"suggest": {
"ext-geos": "GEOS allows more advanced operations"
},
"scripts": {
"tests": [
"@cs",
"@cs-warning",
"@stan",
"@unit",
"@test-input",
"@performance"
],
"tests-ci": [
"@cs",
"@stan",
"@unit-clover",
"@test-input",
"@performance"
],
"cs": "vendor/bin/phpcs --cache -n -p src/",
"cs-warning": "vendor/bin/phpcs --cache -p -w src/ || true",
"cs-fix": "vendor/bin/phpcbf --cache -n -p src/",
"stan" : "vendor/bin/phpstan analyze",
"unit": "GEOS_DISABLED=1 vendor/bin/phpunit --coverage-html build/coverage/",
"unit-clover": "GEOS_DISABLED=1 vendor/bin/phpunit --coverage-clover build/logs/clover.xml",
"test-input": "cd tests && php test.php && cd ..",
"performance": "cd tests && php geometryPerformance.php && cd .."
}
}

0 comments on commit b68e65f

Please sign in to comment.