Skip to content

Commit

Permalink
🔧 Travis: various tweaks/fix builds
Browse files Browse the repository at this point in the history
⚠️ PR 52 is a pre-requisite for this PR ⚠️

This PR builds onto the changes made in PR 52 by gapple and PR 52 should be merged first (if accepted). After that, this PR should be rebased to make it mergeable. Please feel free to ping me to rebase.

## Proposed Changes

* Fix the PHP 5.3 build by instructing Travis to use the `precise` image instead of the `trusty` image for which PHP 5.3 is no longer available.
* Don't allow the PHP 5.3/5.4/5.5 builds to fail. After PR 52, they shouldn't be failing anymore, so there's no need to allow them to fail.
* Run the PHPCS code style and cross-version compatibility only once.
    All PHPCS sniffs are unit tested and written to give the same results on all supported PHP versions, so there is no need for the PHPCS check to be run on each and every build.
    Using the `SNIFF` environment variable, the PHPCS check is now run only on the PHP 7.2 build.
* Remove the command-line parameters from the PHPCS command.
    All relevant settings are already contained in the `phpcs.xml.dist` file and PHPCS will automatically use that file if found, so there is no need to pass these parameters on the command-line.
   N.B.: Previously, i.e. pre-PR 52, the PHPCS check would have been run before the `composer install` which meant that the `PHPCompatibility` standard used would not (yet) be available.
    As PR 52, changed the order in which these commands are run, the `PHPCompatibility` standard should now be available at the time of running PHPCS.
  • Loading branch information
jrfnl committed Sep 7, 2018
1 parent 4f24d36 commit 5d84fc8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ language: php

php:
- hhvm
- 7.2
- 7.1
- 7.0
- 5.6
- 5.5
- 5.4
- 5.3

# This triggers builds to run on the new (faster) TravisCI infrastructure.
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
Expand All @@ -24,11 +22,16 @@ env:
- PATH="${HOME}/bin:${PATH}"

matrix:
include:
- php: 7.2
env: SNIFF=1
- php: 5.3
# As 'trusty' is not supporting PHP 5.2/5.3 anymore, we need to force using 'precise'.
dist: precise

allow_failures:
- php: hhvm
- php: 5.5
- php: 5.4
- php: 5.3

fast_finish: true

before_install:
Expand All @@ -43,5 +46,6 @@ script:
- find . -type f -name "*.php" -print0 | xargs -0 -n1 php -l
- composer validate
- travis_wait composer install --no-interaction --no-progress --no-scripts --no-suggest --optimize-autoloader --prefer-dist --verbose
- ./vendor/bin/phpcs --standard=psr2 src/
- if [[ "$SNIFF" == "1" ]]; then composer install-codestandards; fi
- if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs; fi
- ./vendor/bin/security-checker -n security:check --end-point=http://security.sensiolabs.org/check_lock

0 comments on commit 5d84fc8

Please sign in to comment.