Skip to content

Commit

Permalink
Improving CI/CD Travis settings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Mar 6, 2020
1 parent 1db9755 commit f82af2d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 51 deletions.
105 changes: 55 additions & 50 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
language: php

sudo: false

cache:
directories:
- $HOME/.composer/cache

env:
global:
- COMPOSER_ARGS="--no-interaction --prefer-source --no-suggest"

directories:
- "$HOME/.composer/cache"
matrix:
include:
- php: 7.2
env:
- COLLECT_COVERAGE=true
- IGNORE_PLATFORMS=false
- RUN_PHPSTAN=true
- VALIDATE_CODING_STYLE=false
- php: 7.3
env:
- COLLECT_COVERAGE=true
- IGNORE_PLATFORMS=true
- RUN_PHPSTAN=true
- VALIDATE_CODING_STYLE=true
- php: 7.4
env:
- COLLECT_COVERAGE=false
- VALIDATE_CODING_STYLE=false
- RUN_PHPSTAN=false
- IGNORE_PLATFORMS=true
- php: nightly
env:
- COLLECT_COVERAGE=false
- IGNORE_PLATFORMS=true
- RUN_PHPSTAN=true
- VALIDATE_CODING_STYLE=false
allow_failures:
- php: nightly
fast_finish: true

include:
- php: 7.2
env:
- COLLECT_COVERAGE=false
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source --prefer-lowest --prefer-stable"
- RUN_PHPSTAN=false
- VALIDATE_CODING_STYLE=false
- php: 7.2
env:
- COLLECT_COVERAGE=true
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source"
- RUN_PHPSTAN=true
- VALIDATE_CODING_STYLE=true
- php: 7.3
env:
- COLLECT_COVERAGE=false
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source --prefer-lowest --prefer-stable"
- RUN_PHPSTAN=false
- VALIDATE_CODING_STYLE=false
- php: 7.3
env:
- COLLECT_COVERAGE=true
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source"
- RUN_PHPSTAN=true
- VALIDATE_CODING_STYLE=true
- php: 7.4
env:
- COLLECT_COVERAGE=false
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source --prefer-lowest --prefer-stable"
- RUN_PHPSTAN=false
- VALIDATE_CODING_STYLE=false
- php: 7.4
env:
- COLLECT_COVERAGE=true
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source"
- RUN_PHPSTAN=true
- VALIDATE_CODING_STYLE=true
- php: nightly
env:
- COLLECT_COVERAGE=false
- COMPOSER_ARGS="--no-interaction --no-suggest --prefer-source --ignore-platform-reqs"
- RUN_PHPSTAN=false
- VALIDATE_CODING_STYLE=false
allow_failures:
- php: nightly
fast_finish: true
before_install:
- travis_retry composer self-update

- travis_retry composer self-update
install:
- if [ "$IGNORE_PLATFORMS" == "true" ]; then travis_retry composer update $COMPOSER_ARGS --ignore-platform-reqs; fi
- if [ "$IGNORE_PLATFORMS" == "false" ]; then travis_retry composer update $COMPOSER_ARGS; fi

- travis_retry composer update $COMPOSER_ARGS
script:
- if [ "$RUN_PHPSTAN" == "true" ]; then composer phpstan; fi
- if [ "$VALIDATE_CODING_STYLE" == "true" ]; then composer phpcs; fi
- composer phpunit
- if [ "$VALIDATE_CODING_STYLE" == "true" ]; then composer phpcs; fi
- if [ "$RUN_PHPSTAN" == "true" ]; then composer phpstan; fi

- if [ "$VALIDATE_CODING_STYLE" == "true" ]; then composer phpcs; fi
- if [ "$RUN_PHPSTAN" == "true" ]; then composer phpstan; fi
- composer phpunit
after_script:
- if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/clover.xml; fi
- if [ "$COLLECT_COVERAGE" == "true" ]; then wget https://scrutinizer-ci.com/ocular.phar
&& php ocular.phar code-coverage:upload --format=php-clover build/clover.xml; fi
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"phpunit/phpunit" : "^7.0 | ^8.0",
"phpunit/phpunit" : "^8.0",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan-strict-rules": "^0.12",
"phpstan/phpstan-phpunit": "^0.12"
Expand Down

0 comments on commit f82af2d

Please sign in to comment.