|
| 1 | +# Travis CI (MIT License) configuration file |
| 2 | +# @link https://travis-ci.org/ |
| 3 | + |
| 4 | +# Use new container based environment |
| 5 | +sudo: false |
| 6 | + |
| 7 | +# Declare project language. |
| 8 | +# @link http://about.travis-ci.org/docs/user/languages/php/ |
| 9 | +language: php |
| 10 | + |
| 11 | +env: |
| 12 | + global: |
| 13 | + # Name and folder of the the standard to test. |
| 14 | + - STANDARD="GreynoiseLaravel" |
| 15 | + # 0 For unit test without coverage 1 for unit test with coverage. |
| 16 | + - COVERAGE="1" |
| 17 | + # Upload covarage to clover. |
| 18 | + - CLOVER="0" |
| 19 | + |
| 20 | +matrix: |
| 21 | + fast_finish: true |
| 22 | + |
| 23 | + # Declare versions of PHP to use. Use one decimal max. |
| 24 | + include: |
| 25 | + # aliased to a recent 5.4.x version |
| 26 | + # - php: '5.4' |
| 27 | + # aliased to a recent 5.5.x version |
| 28 | + # - php: '5.5' |
| 29 | + # aliased to a recent 5.6.x version |
| 30 | + # - php: '5.6' |
| 31 | + # aliased to a recent 7.x version |
| 32 | + # - php: '7.0' |
| 33 | + # aliased to a recent 7.x version |
| 34 | + - php: '7.1' |
| 35 | + # aliased to a recent hhvm version |
| 36 | + # - php: 'hhvm' |
| 37 | + # php nightly |
| 38 | + # - php: 'nightly' |
| 39 | + |
| 40 | + # allow_failures: |
| 41 | + # - php: 'hhvm' |
| 42 | + # - php: 'nightly' |
| 43 | + |
| 44 | +before_install: |
| 45 | + # Remove xdebug. |
| 46 | + # - phpenv config-rm xdebug.ini |
| 47 | + # Update composer to latest version |
| 48 | + # - composer self-update |
| 49 | + # Install project composer deps in composer.json |
| 50 | + - composer install |
| 51 | + # Install composer deps in composer.json. |
| 52 | + # - composer require squizlabs/php_codesniffer:dev-master |
| 53 | + # - composer require satooshi/php-coveralls:dev-master |
| 54 | + - phpenv rehash |
| 55 | + |
| 56 | +script: |
| 57 | + # Check for PHP syntax errors. |
| 58 | + - find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l |
| 59 | + # - Check files match the PHPCS standard. |
| 60 | + # - $TRAVIS_BUILD_DIR/vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=*/Tests/* $TRAVIS_BUILD_DIR/$STANDARD/ --standard=$TRAVIS_BUILD_DIR/vendor/squizlabs/php_codesniffer/phpcs.xml.dist |
| 61 | + - ./vendor/bin/phpcs --ignore=*/Tests/* ./$STANDARD/ --standard=./vendor/squizlabs/php_codesniffer/phpcs.xml.dist |
| 62 | + # Change the default standard. |
| 63 | + - ./vendor/bin/phpcs --config-set installed_paths $TRAVIS_BUILD_DIR/$STANDARD |
| 64 | + # Verify it's installed. |
| 65 | + - ./vendor/bin/phpcs -i |
| 66 | + # Run unit tests for the standard with coverage. |
| 67 | + - if [[ "$COVERAGE" == "0" ]]; then ./vendor/bin/phpunit --bootstrap=./vendor/squizlabs/php_codesniffer/tests/bootstrap.php --debug --filter $STANDARD ./vendor/squizlabs/php_codesniffer/tests/AllTests.php; fi |
| 68 | + # Or Run unit tests for the standard with coverage. |
| 69 | + - if [[ "$COVERAGE" == "1" ]]; then ./vendor/bin/phpunit --bootstrap=./vendor/squizlabs/php_codesniffer/tests/bootstrap.php --debug --coverage-clover=$TRAVIS_BUILD_DIR/build/logs/clover.xml --filter $STANDARD ./vendor/squizlabs/php_codesniffer/tests/AllTests.php; fi |
| 70 | + |
| 71 | +after_success: |
| 72 | + - if [[ "$CLOVER" == "1" ]]; then ./vendor/bin/coveralls -v -x $TRAVIS_BUILD_DIR/build/logs/clover.xml; fi |
0 commit comments