forked from api-platform/core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
84 lines (78 loc) · 2.37 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache
- $HOME/.npm
env:
global:
- SYMFONY_DEPRECATIONS_HELPER=weak_vendors
- APP_ENV=test
matrix:
include:
- php: '7.0'
- php: '7.1'
- php: '7.2'
- php: '7.2'
env: lint=1
- php: '7.2'
env: deps=low
- php: '7.2'
env: SYMFONY_DEPRECATIONS_HELPER=0
- php: '7.2'
services:
- postgresql
before_script:
- psql -c 'create database api_platform_test;' -U postgres
env: APP_ENV=postgres
- php: '7.2'
services:
- mysql
before_script:
- mysql -e 'CREATE DATABASE api_platform_test;'
env: APP_ENV=mysql
allow_failures:
env: SYMFONY_DEPRECATIONS_HELPER=0
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
- if [[ $lint = 1 ]]; then
wget https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v2.8.4/php-cs-fixer.phar;
fi
- if [[ $lint = 1 ]]; then
composer global require --dev 'phpstan/phpstan:^0.8';
fi
- export PATH="$PATH:$HOME/.composer/vendor/bin"
install:
- if [[ $deps = 'low' ]]; then
composer update --prefer-dist --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi;
else
composer update --prefer-dist --no-progress --no-suggest --ansi;
fi
script:
- if [[ $lint != 1 ]]; then
tests/Fixtures/app/console cache:clear;
fi
- if [[ $lint != 1 ]]; then
vendor/bin/phpunit;
fi
- if [[ $lint != 1 ]]; then
tests/Fixtures/app/console cache:clear;
fi
- if [[ $APP_ENV = 'postgres' ]]; then
vendor/bin/behat --suite=postgres --format=progress;
elif [[ $lint != 1 ]]; then
vendor/bin/behat --suite=default --format=progress;
fi
- if [[ $lint != 1 ]]; then
tests/Fixtures/app/console api:swagger:export > swagger.json && npx swagger-cli validate swagger.json && rm swagger.json;
fi
- if [[ $lint != 1 ]]; then
tests/Fixtures/app/console api:swagger:export --yaml > swagger.yaml && npx swagger-cli validate --no-schema swagger.yaml && rm swagger.yaml;
fi
- if [[ $lint = 1 ]]; then
php php-cs-fixer.phar fix --dry-run --diff --no-ansi;
fi
- if [[ $lint = 1 ]]; then
phpstan analyse -c phpstan.neon -l5 --ansi src tests;
fi