Skip to content

Commit

Permalink
travisci and styleci configuration upgrade (briannesbitt#1087)
Browse files Browse the repository at this point in the history
* Updated .travis for php 7.2

* Replaced Carbon arguments to self.

* Updated travis configuration.

* Missed one Carbon argument.

* Updated phpstan version in travis.

* Removed phpstan and coverage for the time being.

* Minor modification to php versions.

* Fixed phpstan errors.

* Added php v7.2 (lowest) to allow_failure.

* Minor bug in .travis.yml file :/

* Minor bug in .travis.yml file :/

* Trying to handle phpunit bug.

* Travis fix. Tnx to: https://github.com/CarbonDate/Carbon/blob/1aeda6559fd581a9d9802f5b1eaed38a8b29a935/.travis.yml#L33

* Modified file for PHP-CS-fixer to work.

* Tests fix for issue briannesbitt#1045.
  • Loading branch information
Glavic authored and briannesbitt committed Feb 13, 2018
1 parent a8aeeaa commit cc6e045
Show file tree
Hide file tree
Showing 10 changed files with 144 additions and 138 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
.idea
.vscode
*.iml
.php_cs
.php_cs.cache
vendor
composer.phar
composer.lock
coverage.xml
phpunit.xml
5 changes: 4 additions & 1 deletion .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ $rules = [
'trailing_comma_in_multiline_array' => true,
'trim_array_spaces' => true,
'unary_operator_spaces' => true,
'line_ending' => true,
'blank_line_after_namespace' => true,
'no_unused_imports' => true,
];

return Config::create()->setRules($rules)
->setFinder(Finder::create()->in(__DIR__))
->setUsingCache(true)
->setRiskyAllowed(true);
->setRiskyAllowed(true);
53 changes: 33 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,82 @@ cache:
directories:
- $HOME/.composer/cache

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

env:
global:
- setup=basic
- coverage=false
- phpstan=false
- setup=basic

sudo: false

before_install:
- if [[ $TRAVIS_PHP_VERSION != 7.1 && $TRAVIS_PHP_VERSION != 'hhvm' && $coverage = 'false' ]]; then phpenv config-rm xdebug.ini; fi
- if [[ $coverage = 'false' ]]; then phpenv config-rm xdebug.ini; fi

install:
- if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction --no-suggest; fi
- if [[ $phpstan = 'true' ]]; then travis_retry composer require --dev phpstan/phpstan; fi
- if [[ $setup = 'basic' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest; fi
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable; fi
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable --prefer-lowest; fi
- |
if [[ $setup = 'lowest' ]]; then
composer require sebastian/comparator:"~1.2.4" --no-update --dev
travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable --prefer-lowest
fi
script:
- vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
- if [[ $phpstan = 'true' ]]; then travis_retry composer require --dev phpstan/phpstan:^0.6 && vendor/bin/phpstan analyse --configuration phpstan.neon --level 3 src tests; fi
- if [[ $phpstan = 'true' ]]; then vendor/bin/phpstan analyse --configuration phpstan.neon --level 3 src tests; fi

after_success:
- if [[ $coverage = 'true' ]]; then bash <(curl -s https://codecov.io/bash); fi

matrix:
include:
- php: 5.3
dist: precise
- php: 5.3
dist: precise
env: setup=lowest
- php: 5.3
dist: precise
env: setup=stable

- php: 5.4
- php: 5.4
env: setup=lowest
- php: 5.4
env: setup=stable

- php: 5.5
- php: 5.5
env: setup=lowest
- php: 5.5
env: setup=stable

- php: 5.6
- php: 5.6
env: setup=lowest
- php: 5.6
env: setup=stable

- php: 7.0
- php: 7.0
env: setup=lowest
- php: 7.0
env:
- phpstan=true
- setup=stable
env: setup=stable

- php: 7.1
- php: 7.1
env: setup=lowest
- php: 7.1
env: setup=stable

- php: 7.2
env:
- coverage=true
- phpstan=true
- setup=stable
allow_failures:
- php: hhvm
- php: 7.2
env: setup=lowest
- php: 7.2
env: setup=stable

fast_finish: true
9 changes: 5 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
parameters:
ignoreErrors:
- '#Access to an undefined property Carbon\\Carbon::\$doesNotExit#'
- '#Call to an undefined static method Carbon\\CarbonInterval#'
- '#Property Carbon\\Carbon::\$timezone \(DateTimeZone\) does not accept string#'
- '#Property Carbon\\Carbon::\$tz \(DateTimeZone\) does not accept string#'
- '#Static call to instance method Carbon\\CarbonInterval::#'
excludes_analyse:
- '*/tests/Carbon/SettersTest.php'
- '*/tests/Carbon/GettersTest.php'
- '*/tests/CarbonInterval/GettersTest.php'
Loading

0 comments on commit cc6e045

Please sign in to comment.