mirror of
https://github.com/dg/dibi.git
synced 2025-08-04 05:07:36 +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.0
|
||||||
- 7.1
|
- 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:
|
script:
|
||||||
- vendor/bin/tester tests -s -p php -c tests/php-unix.ini $COVERAGE
|
- vendor/bin/tester tests -s -p php -c tests/php-unix.ini $coverageArgs
|
||||||
- php temp/code-checker/src/code-checker.php --short-arrays
|
- >
|
||||||
|
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:
|
after_failure:
|
||||||
# Print *.actual content
|
# Print *.actual content
|
||||||
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
|
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
# Install Nette Tester & Code Checker
|
# Install Nette Tester
|
||||||
- travis_retry composer install --no-interaction
|
- travis_retry composer install --no-interaction --prefer-dist
|
||||||
- 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
|
|
||||||
|
|
||||||
# Create databases.ini
|
# Create databases.ini
|
||||||
- cp ./tests/databases.travis.ini ./tests/databases.ini
|
- cp ./tests/databases.travis.ini ./tests/databases.ini
|
||||||
@@ -26,13 +40,21 @@ before_script:
|
|||||||
# Create Postgre database
|
# Create Postgre database
|
||||||
- psql -c 'CREATE DATABASE dibi_test' -U postgres
|
- 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:
|
after_script:
|
||||||
# Report Code Coverage
|
# Report Code Coverage
|
||||||
- >
|
- >
|
||||||
if [ "$COVERAGE" != "" ]; then
|
if [ "$coverage" ]; then
|
||||||
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
|
wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
|
||||||
&& php coveralls.phar --verbose --config tests/.coveralls.yml
|
&& php coveralls.phar --verbose --config tests/.coveralls.yml;
|
||||||
|| true; fi
|
fi
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user