Skip to content

Commit

Permalink
Standardize CI
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-davis committed Feb 10, 2020
1 parent 4972914 commit 6b04751
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
20 changes: 16 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,28 @@ php:
- 7.3
- 7.4

env:
global:
- MEMCACHED_SERVER=127.0.0.1
- RUN_PHPSTAN="FALSE"
matrix:
- PREFER_LOWEST="" WITH_COVERAGE="--coverage-clover=coverage.xml"
- PREFER_LOWEST="--prefer-lowest" $WITH_COVERAGE=""

matrix:
include:
- name: 'PHPStan'
php: 7.4
env: RUN_PHPSTAN="TRUE"
fast_finish: true

before_script:
- composer install
- composer update $PREFER_LOWEST

script:
- php vendor/bin/php-cs-fixer fix --dry-run --diff
- php vendor/bin/phpstan analyse -c phpstan.neon lib tests
- php vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=coverage.xml
- if [ $RUN_PHPSTAN == "FALSE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi
- if [ $RUN_PHPSTAN == "FALSE" ]; then php vendor/bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE; fi
- if [ $RUN_PHPSTAN == "TRUE" ]; then composer phpstan; fi

after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "~2.16.1",
"phpunit/phpunit" : "^7 || ^8",
"phpunit/phpunit" : "^7.5 || ^8.5",
"phpstan/phpstan": "^0.12"
},
"suggest" : {
Expand Down Expand Up @@ -89,13 +89,13 @@
},
"scripts": {
"phpstan": [
"@php vendor/bin/phpstan analyse lib tests"
"phpstan analyse lib tests"
],
"cs-fixer": [
"@php vendor/bin/php-cs-fixer fix"
"php-cs-fixer fix"
],
"phpunit": [
"@php vendor/bin/phpunit --configuration tests/phpunit.xml"
"phpunit --configuration tests/phpunit.xml"
],
"test": [
"composer phpstan",
Expand Down
5 changes: 1 addition & 4 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,13 @@
>
<testsuites>
<testsuite name="Sabre\VObject">
<directory>VObject/</directory>
<directory>.</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../lib/</directory>
<exclude>
<file>../lib/Sabre/VObject/includes.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>

0 comments on commit 6b04751

Please sign in to comment.