mirror of
https://github.com/dg/dibi.git
synced 2025-07-30 19:00:13 +02:00
travis: tested using Nette Coding Standard
This commit is contained in:
40
.travis.yml
40
.travis.yml
@@ -6,19 +6,33 @@ php:
|
||||
- 7.0
|
||||
- 7.1
|
||||
|
||||
env:
|
||||
matrix:
|
||||
include:
|
||||
- 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 -p php -c tests/php-unix.ini $COVERAGE
|
||||
- php temp/code-checker/src/code-checker.php --short-arrays
|
||||
- vendor/bin/tester tests -s -p php -c tests/php-unix.ini $coverageArgs
|
||||
- >
|
||||
if [ "$codingStandard" ]; then
|
||||
php temp/code-checker/src/code-checker.php --short-arrays
|
||||
&& php temp/coding-standard/ecs check src tests --config temp/coding-standard/coding-standard-php56.neon;
|
||||
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
|
||||
- travis_retry composer install --no-interaction
|
||||
- travis_retry composer create-project nette/code-checker temp/code-checker ~2.5 --no-interaction
|
||||
- if [ $TRAVIS_PHP_VERSION == "7.0" ]; then COVERAGE="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi
|
||||
# Install Nette Tester
|
||||
- travis_retry composer install --no-interaction --prefer-dist
|
||||
|
||||
# Create databases.ini
|
||||
- cp ./tests/databases.travis.ini ./tests/databases.ini
|
||||
@@ -26,13 +40,21 @@ before_script:
|
||||
# Create Postgre database
|
||||
- psql -c 'CREATE DATABASE dibi_test' -U postgres
|
||||
|
||||
# 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;
|
||||
fi
|
||||
- if [ "$coverage" ]; then coverageArgs="-p phpdbg --coverage ./coverage.xml --coverage-src ./src"; fi
|
||||
|
||||
after_script:
|
||||
# Report Code Coverage
|
||||
- >
|
||||
if [ "$COVERAGE" != "" ]; 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
|
||||
|
||||
|
Reference in New Issue
Block a user