Skip to content

Commit

Permalink
Perform incremental coding standard checks for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Majkl578 committed Nov 14, 2018
1 parent ebea009 commit 871015c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,30 @@ jobs:
script: php phpbench.phar run -l dots --report=default

- stage: Code Quality
if: NOT type = pull_request
env: DB=none CODING_STANDARDS
php: nightly
php: 7.1
script:
- ./vendor/bin/phpcs

- stage: Code Quality
if: type = pull_request
env: DB=none PULL_REQUEST_CODING_STANDARDS
php: 7.1
script:
- |
if [ $TRAVIS_BRANCH != "master" ]; then
git remote set-branches --add origin $TRAVIS_BRANCH;
git fetch origin $TRAVIS_BRANCH;
fi
- git merge-base origin/$TRAVIS_BRANCH $TRAVIS_PULL_REQUEST_SHA || git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge --unshallow
- wget https://github.com/diff-sniffer/git/releases/download/0.2.0/git-phpcs.phar
- php git-phpcs.phar origin/$TRAVIS_BRANCH...$TRAVIS_PULL_REQUEST_SHA

allow_failures:
- php: nightly
- stage: Code Quality
env: DB=none CODING_STANDARDS

cache:
directories:
Expand Down

0 comments on commit 871015c

Please sign in to comment.