forked from PHP-CS-Fixer/PHP-CS-Fixer
-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.travis.yml
80 lines (71 loc) · 2.75 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
language: php
sudo: false
matrix:
fast_finish: true
include:
- php: 5.3
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
- php: 5.4
- php: 5.5
- php: 5.6
env: DEPLOY=yes
- php: 7.0
env: SYMFONY_VERSION="~2.8"
- php: 7.0
env: LINT_TEST_CASES=1
- php: 7.1
env: LINT_TEST_CASES=1
# Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
- php: hhvm-3.9
sudo: required
dist: trusty
group: edge
- php: hhvm
sudo: required
dist: trusty
group: edge
cache:
directories:
- $HOME/.composer/cache
before_install:
- git config --global github.accesstoken 5e7538aa415005c606ea68de2bbbade0409b4b8c
- |
if [ $TRAVIS_TAG ]; then
# for tag building for release we don't need to collect code coverage, let us turn off xdebug completely
phpenv config-rm xdebug.ini || return 0
else
# for regular build we care about collecting code coverage, let us turn off xdebug only for installation part
mv $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini $HOME/xdebug.ini || return 0
fi
- travis_retry composer global require hirak/prestissimo
- 'if [ "$SYMFONY_VERSION" != "" ]; then sed -i "s/\"symfony\/\([^\"]*\)\": \"[^\"]*\"/\"symfony\/\1\": \"$SYMFONY_VERSION\"/g" composer.json; fi'
install:
- travis_retry composer update $COMPOSER_FLAGS --no-interaction
script:
- cp $HOME/xdebug.ini $HOME/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini || return 0
- composer test-ci
- phpenv config-rm xdebug.ini || return 0
- php php-cs-fixer --diff --dry-run -v fix
after_success:
- php vendor/bin/coveralls -v
before_deploy:
# install box2
- curl -LSs http://box-project.github.io/box2/installer.php | php
- php box.phar --version
# ensure that deps will work on lowest supported PHP version
- |
sed -i 's#"config":\s*{#"config": {\n "platform": {"php": "5.3.6"},#' composer.json
# update deps to highest possible for lowest supported PHP version
- composer update --no-dev --no-interaction --optimize-autoloader --prefer-stable
# build phar file
- php -d phar.readonly=false box.phar build
deploy:
provider: releases
api_key:
secure: K9NKi7X1OPz898fxtVc1RfWrSI+4hTFFYOik932wTz1jC4dQJ64Khh1LV9frA1+JiDS3+R6TvmQtpzbkX3y4L75UrSnP1ADH5wfMYIVmydG3ZjTMo8SWQWHmRMh3ORAKTMMpjl4Q7EkRkLp6RncKe+FAFPP5mgv55mtIMaE4qUk=
file: php-cs-fixer.phar
skip_cleanup: true
on:
repo: FriendsOfPHP/PHP-CS-Fixer
tags: true
condition: $DEPLOY = yes