-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
161 lines (150 loc) · 5.11 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
language: php
sudo: false
cache:
directories:
- $HOME/.composer/cache/files
matrix:
fast_finish: true
include:
- php: 5.4
env:
- SYMFONY_VERSION="2.3.*"
- PHPUNIT=phpunit-4.8
- TEST_LINT=`true`
- php: 5.5
env:
- SYMFONY_VERSION="2.7.*"
- PHPUNIT=phpunit-4.8
- TEST_LINT=`true`
- SENSIO_SECURITY=`true`
- php: 5.5
env:
- SYMFONY_LTS="2"
- PHPUNIT=phpunit-4.8
- TEST_LINT=`true`
- SENSIO_SECURITY=`true`
- php: 5.6
env:
# - SYMFONY="3"
- PHPUNIT=phpunit-5.7
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.0
env:
# - SYMFONY="3"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.1
env:
- SYMFONY_LTS="3"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.1
env:
# - SYMFONY="4"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.2
env:
- SYMFONY_LTS="3"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.2
env:
# - SYMFONY="4"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.3
env:
- SYMFONY_LTS="3"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: 7.3
env:
# - SYMFONY="4"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- PHP_CS_FIXER=`true`
- SENSIO_SECURITY=`true`
- php: nightly
env:
- SYMFONY_LTS="3"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- SENSIO_SECURITY=`true`
- php: nightly
env:
# - SYMFONY="4"
- PHPUNIT=phpunit
- TEST_LINT=`true`
- SENSIO_SECURITY=`true`
allow_failures:
- php: 5.4
- php: 5.5 # needs older phpunit
- php: 5.6 # Sensio security
- php: 7.0 # Sensio security
- php: 7.3
- php: nightly
before_install:
- echo $PHPUNIT
- pwd
- echo $HOME
- echo $TRAVIS_PHP_VERSION
- which composer
- ls /tmp
- php --ini
- xdebug=/home/travis/.phpenv/versions/$TRAVIS_PHP_VERSION/etc/conf.d/xdebug.ini
- if [[ -f $xdebug ]]; then cat $xdebug; cp $xdebug /tmp; phpenv config-rm xdebug.ini; fi
- xdebug_php=
- if [[ -f /tmp/xdebug.ini ]]; then xdebug_php='-c /tmp/xdebug.ini'; fi
- install --directory .travis/bin
- if [[ -v PHP_CS_FIXER ]]; then wget http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar --output-document=.travis/bin/php-cs-fixer; fi
- if [[ -v PHPUNIT ]]; then wget https://phar.phpunit.de/${PHPUNIT}.phar --output-document=.travis/bin/$PHPUNIT; fi
- if [[ -v SENSIO_SECURITY ]]; then wget http://get.sensiolabs.org/security-checker.phar --output-document=.travis/bin/security-checker; fi
install:
- composer validate
- if [[ -v SYMFONY_VERSION ]]; then composer require symfony/symfony:${SYMFONY_VERSION} --no-scripts --no-progress --no-suggest; fi
- if [[ -v SYMFONY_LTS ]]; then composer require symfony/lts:${SYMFONY_LTS} --no-scripts --no-progress --no-suggest; fi
- if [[ -f config/parameters.yml.travis ]]; then cp config/parameters.yml.travis config/parameters.yml; fi
- composer install --no-progress --no-suggest --optimize-autoloader --apcu-autoloader
- composer show
before_script:
script:
- for f in $(find . -path './vendor' -prune -o -path './tests' -prune -o -name \*.php -print) ; do php -l $f ; done # Do this first!
- if [[ -v TEST_LINT ]]; then for f in $(find ./tests -name \*.php -print); do php -l $f; done; fi
- if [[ -v PHP_CS_FIXER ]]; then php .travis/bin/php-cs-fixer --version; fi
- if [[ -v PHP_CS_FIXER ]]; then php .travis/bin/php-cs-fixer fix --diff --dry-run -vvv --using-cache=no; fi # --stop-on-violation
# - if [[ -v PHPUNIT ]]; then php --ini -c /tmp/xdebug.ini; php $xdebug_php .travis/bin/$PHPUNIT --colors=always; fi
- if [[ -v SENSIO_SECURITY ]]; then php .travis/bin/security-checker security:check; fi
#^ This checks that the application doesn't use dependencies with known security vulnerabilities
- if [[ -v VENDOR_LINT ]]; then for f in $(find ./vendor -name \*.php); do php -l $f > /dev/null; done; fi
#^ Should be the last line of install but sometimes long to execute and little can be done for errors found.
# - ./vendor/bin/simple-phpunit
# this checks that the source code follows the Symfony Code Syntax rules
# 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
# 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
# - ./bin/console security:check --end-point=http://security.sensiolabs.org/check_lock
after_success:
- bash <(curl -s https://codecov.io/bash) -s /tmp
# inspirated from:
# symfony/symfony-demo
# https://github.com/doctrine/dbal/blob/v2.5.13/.travis.yml