Skip to content

Commit

Permalink
travis: finely segmented matrix, added PhpStan, NCS
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 6, 2019
1 parent 03d3972 commit 57f3a01
Showing 1 changed file with 47 additions and 22 deletions.
69 changes: 47 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,66 @@
language: php
php:
- 7.1
- 7.2
- 7.3

env:
matrix:
include:
- php: 7.1
env: coverage=on
before_install:
# turn off XDebug
- phpenv config-rm xdebug.ini || return 0

allow_failures:
- php: 7.1
env: coverage=on
install:
- travis_retry composer install --no-progress --prefer-dist

script:
- vendor/bin/tester tests -s $coverageArgs
- php temp/code-checker/src/code-checker.php --short-arrays
- vendor/bin/tester tests -s

after_failure:
# Print *.actual content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done

before_script:
# Install Nette Tester & Code Checker
- travis_retry composer install --no-interaction --prefer-dist
- travis_retry composer create-project nette/code-checker temp/code-checker ~2.5 --no-interaction
- if [ "$coverage" == "on" ]; then coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi
jobs:
include:
- name: Nette Code Checker
install:
- travis_retry composer create-project nette/code-checker temp/code-checker ^3 --no-progress
script:
- php temp/code-checker/code-checker --strict-types


- name: Nette Coding Standard
install:
- travis_retry composer create-project nette/coding-standard temp/coding-standard ^2 --no-progress
script:
- php temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php71.yml


- stage: Static Analysis (informative)
install:
# Install PHPStan
- travis_retry composer create-project phpstan/phpstan-shim temp/phpstan --no-progress
- travis_retry composer install --no-progress --prefer-dist
script:
- php temp/phpstan/phpstan.phar analyse --autoload-file vendor/autoload.php --level 5 src


- stage: Code Coverage
script:
- vendor/bin/tester -p phpdbg tests -s --coverage ./coverage.xml --coverage-src ./src
after_script:
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- php coveralls.phar --verbose --config tests/.coveralls.yml


allow_failures:
- stage: Static Analysis (informative)
- stage: Code Coverage

after_script:
# Report Code Coverage
- >
if [ "$coverage" == "on" ]; then
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
&& php coveralls.phar --verbose --config tests/.coveralls.yml
|| true; fi

sudo: false

cache:
directories:
- $HOME/.composer/cache

notifications:
email: false

0 comments on commit 57f3a01

Please sign in to comment.