diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 9b52b7b..ff48294 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -31,5 +31,8 @@ jobs: - name: Install dependencies run: composer install --prefer-dist --no-progress + - name: Run php static analyse + run: make analyse + - name: Run test suite - run: composer run-script test + run: make test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5ad82f9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: php - -cache: - directories: - - vendor/ - -before_install: - # Disable xdebug if php version != 7.2 (only use xdebug for reports) - - if [[ $ENABLE_CODE_COVERAGE == false ]]; then phpenv config-rm xdebug.ini; fi - # Enable mongo/mongodb extension regarding php version - - echo "extension = ${MONGO_EXT_NAME}.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - echo "php ext-${MONGO_EXT_NAME} extension enabled." - # Require alcaeus/mongo-php-adapter for php >= 7 tests - - if [[ $TRAVIS_PHP_VERSION == 7.* ]]; then composer config "platform.ext-mongo" "1.6.16" && composer require alcaeus/mongo-php-adapter; fi - # Require doctine collections/orm/mongodb to launch ALL tests - - composer require doctrine/collections:">=1.0" doctrine/orm:">=2.0" doctrine/mongodb:">=1.0" - -env: - global: - - MONGO_EXT_NAME=mongo - - ENABLE_CODE_COVERAGE=false - -before_script: - - composer install - -script: - - ./vendor/bin/phpunit --coverage-clover=coverage.xml - -after_success: - - if [[ $ENABLE_CODE_COVERAGE ]]; then bash <(curl -s https://codecov.io/bash); fi - -matrix: - include: -#===== TESTS - - php: '5.3' - dist: precise - - php: '5.4' - - php: '5.5' - - php: '5.6' - - php: '7.0' - env: - - MONGO_EXT_NAME=mongodb - - php: '7.1' - env: - - MONGO_EXT_NAME=mongodb - - php: '7.2' - env: - - MONGO_EXT_NAME=mongodb - - ENABLE_CODE_COVERAGE=true -#===== CODE INSPECTION - - stage: 'code-inspection' - php: '7.2' - env: '' - before_install: '' - before_script: - - composer require phpmd/phpmd:"@stable" squizlabs/php_codesniffer:"@stable" - - composer install - install: skip - script: - - ./vendor/bin/phpcs --config-set ignore_warnings_on_exit 1 - - ./vendor/bin/phpcs --standard=PSR1 src/ - - ./vendor/bin/phpcs --standard=PSR2 src/ -# - ./vendor/bin/phpmd src/ text codesize,unusedcode,naming,design,cleancode diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d1057ee --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +default: install test stan + +install: + composer install + +test: + vendor/bin/phpunit + +cs: + vendor/bin/php-cs-fixer fix + +analyse: + vendor/bin/phpstan diff --git a/composer.json b/composer.json index 1ec1b18..42a2640 100644 --- a/composer.json +++ b/composer.json @@ -35,11 +35,6 @@ "friendsofphp/php-cs-fixer": "^3.41", "phpstan/phpstan": "^1.10" }, - "scripts": { - "test": "vendor/bin/phpunit", - "cs": "vendor/bin/php-cs-fixer fix", - "stan": "vendor/bin/phpstan analyse" - }, "suggest": { "doctrine/collections": "If you want filter an ArrayCollection", "doctrine/orm": "If you want filter an ORM query builder"