forked from api-platform/schema-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
63 lines (55 loc) · 2.87 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache
matrix:
include:
- php: '7.1'
- php: '7.2'
env: coverage=1 lint=1
- php: '7.2'
env: deps='low'
before_install:
- phpenv config-rm xdebug.ini || echo "xdebug not available"
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- export PATH="$PATH:$HOME/.composer/vendor/bin"
- wget https://phar.phpunit.de/phpunit-6.5.phar
- composer global require humbug/php-scoper:dev-master#674e24d2b9e90b2f629dab7f30d5070e4d49d815
- 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.8'; fi
- if [[ ! $deps && $TRAVIS_PHP_VERSION = "7.2" ]]; then curl -LSs https://box-project.github.io/box2/installer.php | php; fi;
install:
- if [[ $coverage = 1 ]]; then composer require --dev --no-update 'phpunit/php-code-coverage:^5.3'; fi
- if [[ ! $deps ]]; 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-6.3.phar --coverage-clover build/logs/clover.xml; else php phpunit-6.5.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
composer install --no-dev --prefer-dist --classmap-authoritative --no-progress --no-suggest --ansi;
~/.composer/vendor/bin/php-scoper add-prefix --output-dir=build/schema-generator;
composer --working-dir=build/schema-generator dump-autoload --classmap-authoritative --no-dev;
php -d phar.readonly=0 box.phar build;
php schema.phar generate-types tmp/ tests/e2e/schema.yml;
diff tests/e2e/src/AppBundle/Entity/Person.php tmp/AppBundle/Entity/Person.php;
diff tests/e2e/src/AppBundle/Entity/PostalAddress.php tmp/AppBundle/Entity/PostalAddress.php;
diff tests/e2e/src/AppBundle/Entity/Thing.php tmp/AppBundle/Entity/Thing.php;
fi;
after_success:
- if [[ $coverage = 1 ]]; then travis_retry php php-coveralls.phar; fi
deploy:
provider: releases
api_key:
secure: Oq9TAPQZqnjxhbprWZQE64GhK4vxBHjvcMkS9dkbkCJQVz8cSqGxZOFqMOHulraFs2IX9PLeplrZReFMT630KkMNf74mkTtL9WMuaMJV0bbUPY+X7YpDGlLNNU7OA9Rxjr3y68x1jVxD6mLSlCFZP00qvmYRlOE1i2ltjO7L5Sw=
file: schema.phar
skip_cleanup: true
on:
tags: true
repo: api-platform/schema-generator
php: '7.2'
condition: "! $deps"