|
| 1 | +sudo: false |
| 2 | + |
| 3 | +dist: trusty |
| 4 | + |
| 5 | +cache: |
| 6 | + apt: true |
| 7 | + |
| 8 | +language: php |
| 9 | + |
| 10 | +## Cache composer downloads. |
| 11 | +cache: |
| 12 | + directories: |
| 13 | + - $HOME/.cache/composer/files |
| 14 | + |
| 15 | +matrix: |
| 16 | + fast_finish: true |
| 17 | + include: |
| 18 | + - php: 7.2 |
| 19 | + addons: |
| 20 | + apt: |
| 21 | + packages: |
| 22 | + - libxml2-utils |
| 23 | + - php: 5.4 |
| 24 | + |
| 25 | +before_install: |
| 26 | + # Speed up build time by disabling Xdebug when its not needed. |
| 27 | + - if [[ $COVERALLS_VERSION == "notset" ]]; then phpenv config-rm xdebug.ini || echo 'No xdebug config.'; fi |
| 28 | + - export XMLLINT_INDENT=" " |
| 29 | + - composer install |
| 30 | + - vendor/bin/phpcs -i |
| 31 | + |
| 32 | +script: |
| 33 | + - | |
| 34 | + if [[ $TRAVIS_PHP_VERSION == "7.2" ]]; then |
| 35 | + # Validate the xml files. |
| 36 | + # @link http://xmlsoft.org/xmllint.html |
| 37 | + xmllint --noout ./*/ruleset.xml |
| 38 | +
|
| 39 | + # Check the code-style consistency of the xml files. |
| 40 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP54/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP54/ruleset.xml") |
| 41 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP55/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP55/ruleset.xml") |
| 42 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP56/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP56/ruleset.xml") |
| 43 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP70/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP70/ruleset.xml") |
| 44 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP71/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP71/ruleset.xml") |
| 45 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP72/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP72/ruleset.xml") |
| 46 | + diff -B ./PHPCompatibilitySymfonyPolyfillPHP73/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP73/ruleset.xml") |
| 47 | + fi |
| 48 | +
|
| 49 | + # Test the rulesets. |
| 50 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3 |
| 51 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3 |
| 52 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3 |
| 53 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3 |
| 54 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3 |
| 55 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3 |
| 56 | + - vendor/bin/phpcs ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3 |
| 57 | + |
| 58 | + # Validate the composer.json file. |
| 59 | + # @link https://getcomposer.org/doc/03-cli.md#validate |
| 60 | + - composer validate --no-check-all --strict |
0 commit comments