diff --git a/.travis.yml b/.travis.yml index aa56cc2..2c77013 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php - sudo: false +dist: trusty cache: directories: @@ -9,28 +9,39 @@ cache: php: - 7.1 -env: - - # dev - - COMPOSER_EXTRA_ARGS="--prefer-stable" - - COMPOSER_EXTRA_ARGS="--prefer-lowest --prefer-stable" +before_install: + - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available" + - composer self-update + +install: travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist + +script: vendor/bin/phpunit -c tests/phpunit.xml -matrix: - fast_finish: true +jobs: include: - - env: COMPOSER_EXTRA_ARGS="--prefer-stable" COVERAGE="--coverage-clover tests/coverage.xml" - allow_failures: - - env: - -install: - - travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist $COMPOSER_EXTRA_ARGS - - travis_retry composer create-project --no-interaction jakub-onderka/php-parallel-lint /tmp/php-parallel-lint - - if [ "$COVERAGE" != "" ]; then travis_retry wget -O /tmp/coveralls.phar https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar; fi - -script: - - php vendor/bin/phpunit $COVERAGE -c tests/phpunit.xml - - php /tmp/php-parallel-lint/parallel-lint.php -e php,phpt --exclude vendor . - - php vendor/phpstan/phpstan-shim/phpstan.phar analyse --ansi --no-progress -l7 -c phpstan.neon src tests - - php vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 -sp src tests - -after_script: - - if [ "$COVERAGE" != "" ]; then php /tmp/coveralls.phar --verbose --config tests/.coveralls.yml || true; fi + - stage: Test (dev dependencies) + + - stage: Test (stable dependencies) + install: + - travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist --prefer-stable + + - stage: Test (lowest stable dependencies) + install: + - travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist --prefer-lowest --prefer-stable + + - stage: Lint + script: + - vendor/bin/parallel-lint -e php,phpt --exclude vendor . + - vendor/bin/phpstan.phar analyse --ansi --no-progress -l7 -c phpstan.neon src tests + - vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 -sp src tests + + - stage: Coverage + before_script: + - mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,} + - if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi + - travis_retry wget -O /tmp/coveralls.phar https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar + install: + - travis_retry composer update --no-interaction --no-suggest --no-progress --prefer-dist --prefer-stable + script: + - vendor/bin/phpunit --coverage-clover tests/coverage.xml -c tests/phpunit.xml + - php /tmp/coveralls.phar --verbose --config tests/.coveralls.yml diff --git a/composer.json b/composer.json index 172277a..8b75a0c 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,8 @@ "kdyby/coding-standard": "^1.0@dev", "phpstan/phpstan-shim": "^0.7", "phpunit/phpunit": "~6.2", - "symfony/yaml": "^3.3|^4.0" + "symfony/yaml": "^3.3|^4.0", + "jakub-onderka/php-parallel-lint": "^0.9.2" }, "autoload": { "psr-4": {