Skip to content

Commit

Permalink
Fixes global plugin being loaded caused by including "dealerdirect/qa…
Browse files Browse the repository at this point in the history
…-tools" globally

- Uses PHAR files instead of `composer global` install
- Adds PHAR cache and monthly cleanup
- Uses `php -l` instead of `parallel-lint` package
  • Loading branch information
Potherca committed May 10, 2017
1 parent d62b38e commit 0ca1f2b
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,42 @@ php:
# See: http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: false

# Make sure a `bin` directory is present and does not contain PHAR files more
# than 4 weeks old
before_cache:
- mkdir -p "${HOME}/bin"
- find "${HOME}/bin/" -type f -name '*.phar' -mtime +28 -delete

cache:
directories:
- "${HOME}/.composer/cache"

- "${HOME}/.npm/"
- "${HOME}/bin/"
env:
global:
- PATH="${HOME}/bin:${PATH}"

matrix:
allow_failures:
- php: hhvm
- php: 5.5
- php: 5.4
- php: 5.3
- php: hhvm
- php: 5.5
- php: 5.4
- php: 5.3
fast_finish: true

before_install:
- npm set loglevel error
- npm set progress false

install:
- composer global require "dealerdirect/qa-tools:*"
- '[[ -f "${HOME}/bin/phpcs.phar" ]] || curl -L -o "${HOME}/bin/phpcs.phar" https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar'
- '[[ -f "${HOME}/bin/security-checker.phar" ]] || curl -L -o "${HOME}/bin/security-checker.phar" http://get.sensiolabs.org/security-checker.phar'
- npm install -g jsonlint

script:
- find . -type f -name "*.json" -print0 | xargs -0 -n1 jsonlint -q
- find . -type f -name "*.php" -print0 | xargs -0 -n1 php -l
- php "${HOME}/bin/phpcs.phar" --standard=psr2 src/
- composer validate
- travis_wait composer install --no-interaction --no-progress --no-scripts --no-suggest --optimize-autoloader --prefer-dist --verbose
- ~/.composer/vendor/bin/parallel-lint ./src
- ~/.composer/vendor/bin/security-checker -n security:check --end-point=http://security.sensiolabs.org/check_lock
- ~/.composer/vendor/bin/phpcs --standard=psr2 src/

- php "${HOME}/bin/security-checker.phar" -n security:check --end-point=http://security.sensiolabs.org/check_lock

0 comments on commit 0ca1f2b

Please sign in to comment.