-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
129 lines (119 loc) · 5.48 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
language: php
php:
- nightly
- 7.3
# - 7.1
- 7.0
# - 5.6
# - 5.5
# - 5.4
cache:
directories:
- $HOME/.composer/cache/files
addons:
postgresql: "9.6"
services:
- postgresql
matrix:
fast_finish: true
include:
# - php: 5.6
# sudo: true
# increases memory
# - php: 5.4
# sudo: true
# increases memory
# - php: 5.6
# addons:
# apt:
# packages:
# - upstart # upstart is already the newest version (1.12.1-0ubuntu4.2).
# - zram-config # Error on 14.04 Trusty: runlevel:/var/run/utmp: No such file or directory
allow_failures:
- php: nightly
- php: 7.3
- php: 5.6
- php: 5.4
before_install:
- ls --color ~/.phpenv/versions/$(phpenv version-name)
- ls --color ~/.phpenv/versions/$(phpenv version-name)/bin
- file ~/.phpenv/versions/$(phpenv version-name)/bin/composer
- php ~/.phpenv/versions/$(phpenv version-name)/bin/composer
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "memory_limit = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- php -r "echo ini_get('memory_limit').PHP_EOL;"
- swapon --all
- swapon --summary
- cat /proc/swaps
- free -h
- apt-cache policy upstart zram-config
- if [ -f /home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then phpenv config-rm xdebug.ini; fi
- for f in $(find . -path './vendor' -prune -o -name \*.php -print) ; do php -l $f ; done # Do this first!
- composer self-update # May help using cache for php packages.
- which composer
- composer global require --update-no-dev composer/composer
- ls /home/travis/.phpenv/versions/5.6/etc/conf.d
# - phpenv config-add ~travis.php.ini # name choosen for it to be executed after travis.ini
- ls -l --color /home/travis/.phpenv/versions/5.6/etc/conf.d
- pushd /home/travis/.phpenv/versions/5.6/etc/conf.d ; ls | xargs cat ; popd
# Shows the (alphabetical) order used for execution, last executed overrides the parameters
- php -r "echo ini_get('memory_limit').PHP_EOL;"
- psql -c 'create database travis_ci_test;' -U postgres
- psql --dbname=postgres --command='\l'
- psql --dbname=travis_ci_test --command='\d'
- psql --host=/var/run/postgresql --dbname=travis_ci_test --command='\d'
- psql --username=postgres --host=/var/run/postgresql --dbname=travis_ci_test --command='\d'
- psql --help
install:
- composer validate
- if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then composer require --dev friendsofphp/php-cs-fixer; fi
- cp config/parameters.yml.travis config/parameters.yml
# - composer install --no-scripts --no-progress --no-suggest
# - composer up --no-progress --no-suggest --optimize-autoloader --apcu-autoloader
- php -r "echo ini_get('memory_limit').PHP_EOL;" # https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors
# - php -d memory_limit=-1 $(command -v composer) install --no-progress --no-suggest --optimize-autoloader --apcu-autoloader # useless
# - command time composer install --profile --no-dev # split in 2 to try to spare memory
# - command time ~/.composer/vendor/bin/composer require symfony/symfony --profile # This way to install spares memory
- command time ~/.composer/vendor/bin/composer require symfony/lts --profile # This way to install spares memory
# And avoids exausting memory.
# - command time ~/.composer/vendor/bin/composer install --profile
# --no-suggest # To spare memory?
# --no-progress --no-suggest --optimize-autoloader --apcu-autoloader
- ls vendor/autoload.php
- composer why pagerfanta/pagerfanta
- composer why paragonie/random_compat
- composer why php-cs-fixer/diff
- composer why symfony/lts
- composer show --outdated
- chmod u+x ./bin/console
- ./bin/console
- ./bin/console dbal:list-databases
# - ./bin/console doctrine:schema:update ############################### Does it still rely on ORM for schema?
before_script:
script:
- ./bin/console dbal:schema:update
- ./bin/console dbal:schema:getMigrateToSql
- psql --dbname=travis_ci_test --command='\d url'
- psql --dbname=travis_ci_test --command='\d http_user'
- ./bin/console fos:user:create --super-admin admin admin@example.org admin
- ./bin/console fos:user:create user user@example.org user
# this checks that the source code follows the Symfony Code Syntax rules
- if [[ $TRAVIS_PHP_VERSION = '7.1' ]]; then ./vendor/bin/php-cs-fixer fix --stop-on-violation --diff --dry-run -vvv --using-cache=no; fi
# this checks that the YAML config files contain no syntax errors
- ./bin/console lint:yaml config
# - ./bin/console lint:yaml @CodeExplorerBundle
# this checks that the Twig template files contain no syntax errors
# - ./bin/console lint:twig templates @CodeExplorerBundle
- ./bin/console lint:twig templates
# this checks that the XLIFF translations contain no syntax errors
- ./bin/console lint:xliff templates
# this checks that the application doesn't use dependencies with known security vulnerabilities
- ./vendor/bin/simple-phpunit
- ./vendor/bin/simple-phpunit tests
- ./vendor/bin/simple-phpunit failing_tests || true
- ./bin/console security:check # --end-point=http://security.sensiolabs.org/check_lock
# - for f in $(find ./vendor -name \*.php) ; do php -l $f > /dev/null ; done # Should be the last line of install but sometimes long to execute and little can be done for errors found.
# inspirated from
# symfony/symfony-demo
# TODO: https://github.com/doctrine/dbal/blob/v2.5.13/.travis.yml