Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/build/
/vendor/
/*.phar
/.phpunit.result.cache
18 changes: 10 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ matrix:
include:
- php: '7.1'
- php: '7.2'
- php: '7.3'
env: coverage=1 lint=1
- php: '7.2'
- php: '7.3'
env: deps='low'

before_install:
Expand All @@ -18,22 +19,23 @@ before_install:
- export PATH="$PATH:$HOME/.composer/vendor/bin"
- wget -O phpunit.phar https://phar.phpunit.de/phpunit-7.5.phar
- if [[ $coverage = 1 ]]; then mkdir -p build/logs; fi
- if [[ $coverage = 1 ]]; then wget https://github.com/satooshi/php-coveralls/releases/download/v2.0.0/php-coveralls.phar; fi
- if [[ $lint = 1 ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.10.0/php-cs-fixer.phar; fi
- if [[ $lint = 1 ]]; then composer global require --dev 'phpstan/phpstan:^0.10'; fi
- wget -O box.phar https://github.com/humbug/box/releases/download/3.2.0/box.phar
- if [[ $coverage = 1 ]]; then wget https://github.com/satooshi/php-coveralls/releases/download/v2.1.0/php-coveralls.phar; fi
- if [[ $lint = 1 ]]; then wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.16.0/php-cs-fixer.phar; fi
- if [[ $lint = 1 ]]; then composer global require --dev 'phpstan/phpstan:^0.11'; fi
- wget -O box.phar https://github.com/humbug/box/releases/download/3.8.3/box.phar
- export BOX_BIN=$(pwd)/box.phar

install:
- if [[ $coverage = 1 ]]; then composer require --dev --no-update 'phpunit/php-code-coverage:^5.3'; fi
- if [[ ! $deps ]]; then composer install --prefer-dist --no-progress --no-suggest --ansi; fi
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "7.3" ]]; then composer install --prefer-dist --no-progress --no-suggest --ansi; fi
- if [[ $TRAVIS_PHP_VERSION != "7.3" ]]; then composer update --prefer-dist --no-progress --no-suggest --ansi; fi
- if [[ $deps = 'low' ]]; then composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi; fi

script:
- if [[ $coverage = 1 ]]; then phpdbg -qrr phpunit.phar --coverage-clover build/logs/clover.xml; else php phpunit.phar; fi
- if [[ $lint = 1 ]]; then php php-cs-fixer.phar fix --dry-run --diff --no-ansi; fi
- if [[ $lint = 1 ]]; then phpstan analyse -l5 --ansi src; fi
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "7.2" ]]; then ./bin/compile; fi
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "7.3" ]]; then ./bin/compile; fi

after_success:
- if [[ $coverage = 1 ]]; then travis_retry php php-coveralls.phar; fi
Expand All @@ -47,5 +49,5 @@ deploy:
on:
tags: true
repo: api-platform/schema-generator
php: '7.2'
php: '7.3'
condition: "! $deps"
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -eox pipefail

php $BOX_BIN compile;
php "$BOX_BIN" compile;

php schema.phar generate-types tmp/ tests/e2e/schema.yml;

Expand Down
5 changes: 2 additions & 3 deletions box.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"files": [
"vendor/friendsofphp/php-cs-fixer/tests/TestCase.php",
"vendor/twig/twig/lib/Twig/Test.php"
"vendor/twig/twig/src/TwigTest.php"
],
"directories": [
"vendor/friendsofphp/php-cs-fixer/tests/Test"
Expand All @@ -24,8 +24,7 @@
"compression": "GZ",
"compactors": [
"KevinGH\\Box\\Compactor\\Json",
"KevinGH\\Box\\Compactor\\Php",
"KevinGH\\Box\\Compactor\\PhpScoper"
"KevinGH\\Box\\Compactor\\Php"
],

"git-version": "package_version",
Expand Down
Loading