Skip to content

Commit

Permalink
travis: tested using Nette Coding Standard
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 13, 2017
1 parent 696a57f commit d6aa86e
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,45 @@ matrix:
env: dependencies="--prefer-lowest --prefer-stable"
- php: 7.1
env: coverage=on
- php: 7.1
env: codingStandard=on

allow_failures:
- php: 7.1
env: coverage=on

script:
- vendor/bin/tester tests -s -c tests/php-unix.ini $coverageArgs
- php temp/code-checker/src/code-checker.php --short-arrays --strict-types -i netteForms
- if [ "$dependencies" ]; then grunt --gruntfile=tests/netteForms/Gruntfile.js test; fi
- >
if [ "$codingStandard" ]; then
php temp/code-checker/src/code-checker.php --short-arrays --strict-types
&& php temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php71.neon
&& grunt --gruntfile=tests/netteForms/Gruntfile.js test;
fi
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
# Install Nette Tester
- travis_retry composer update --no-interaction --prefer-dist $dependencies
- travis_retry composer create-project nette/code-checker temp/code-checker ~2.8 --no-interaction
- if [ "$dependencies" ]; then npm install -g grunt-cli; cd tests/netteForms; npm install; cd ../..; fi
- if [ "$coverage" == "on" ]; then coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi
# Install Code Checkers
- >
if [ "$codingStandard" ]; then
travis_retry composer create-project nette/code-checker temp/code-checker ~2 --no-interaction;
travis_retry composer create-project nette/coding-standard temp/coding-standard --no-interaction;
npm install -g grunt-cli; cd tests/netteForms; npm install; cd ../..;
fi
- if [ "$coverage" ]; then coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi

after_script:
# Report Code Coverage
- >
if [ "$coverage" == "on" ]; then
if [ "$coverage" ]; 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
&& php coveralls.phar --verbose --config tests/.coveralls.yml;
fi
sudo: false

Expand Down

0 comments on commit d6aa86e

Please sign in to comment.