@@ -5,104 +5,112 @@ sudo: false
55git :
66 depth : 1
77
8- env :
9- global :
10- - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress --optimize-autoloader"
11- - TASK_TESTS=1
12- - TASK_TESTS_COVERAGE=0
13- - TASK_CS=1
14- - TASK_SCA=0
15-
16- matrix :
17- fast_finish : true
18- include :
19- - php : 7.1
20- env : DEPLOY=yes TASK_TESTS_COVERAGE=1
21- - php : nightly
22- env : TASK_SCA=1 COMPOSER_FLAGS="--ignore-platform-reqs" SYMFONY_DEPRECATIONS_HELPER=weak PHP_CS_FIXER_IGNORE_ENV=1
23- - php : 5.6
24- env : COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
25- - php : 7.0
26- env : SYMFONY_DEPRECATIONS_HELPER=weak PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER=1
27-
288cache :
299 directories :
3010 - $HOME/.composer
3111
32- before_install :
33- # check phpdbg
34- - phpdbg --version 2> /dev/null || { echo 'No phpdbg'; export TASK_TESTS_COVERAGE=0; }
12+ env :
13+ global :
14+ - DEFAULT_COMPOSER_FLAGS="--no-interaction --no-progress"
15+ - COMPOSER_FLAGS=""
3516
17+ before_install :
3618 # turn off XDebug
3719 - phpenv config-rm xdebug.ini || return 0
3820
39- # validate tasks configuration
40- - if [ $TASK_TESTS == 0 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then travis_terminate 1; fi
41-
42- # for building a tag release we don't need to run SCA tools, collect code coverage or self-fix CS
43- - if [ $TRAVIS_TAG ]; then export TASK_SCA=0; fi
44- - if [ $TRAVIS_TAG ]; then export TASK_TESTS_COVERAGE=0; fi
45- - if [ $TRAVIS_TAG ]; then export TASK_CS=0; fi
46-
4721 # Composer: boost installation
4822 - composer global show -ND 2>&1 | grep "hirak/prestissimo" || travis_retry composer global require $DEFAULT_COMPOSER_FLAGS hirak/prestissimo
4923
50- # display tasks configuration for a job
51- - set | grep ^TASK | sort
52-
53- install :
54- - if [ $TASK_SCA == 1 ]; then travis_retry composer global require $DEFAULT_COMPOSER_FLAGS maglnet/composer-require-checker:^0.1.4; fi
55- - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
56- - composer info -D | sort
57-
58- before_script :
59- - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then COMMIT_RANGE=$TRAVIS_COMMIT_RANGE; else COMMIT_RANGE="HEAD~..HEAD"; fi;
60- - if [ $TASK_SCA == 1 ]; then export COMMIT_SCA_FILES=`git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE`; fi
61-
62- script :
63- - if [ $TASK_SCA == 1 ]; then ./check_trailing_spaces.sh || travis_terminate 1; fi
64- - if [ $TASK_SCA == 1 ] && [ -n "$COMMIT_SCA_FILES" ]; then vendor/bin/phpmd `echo "$COMMIT_SCA_FILES" | grep -Ev "^(src/Resources|tests/Fixtures)" | xargs | sed 's/ /,/g'` text phpmd.xml || travis_terminate 1; fi;
65- - if [ $TASK_SCA == 1 ]; then php php-cs-fixer fix --rules @PHP71Migration,@PHP71Migration:risky,native_function_invocation -q; fi
66- - if [ $TASK_SCA == 1 ]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS --no-dev --prefer-stable; fi
67- - if [ $TASK_SCA == 1 ]; then $HOME/.composer/vendor/bin/composer-require-checker check composer.json --config-file=.composer-require-checker.json || travis_terminate 1; fi
68- - if [ $TASK_SCA == 1 ]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS; fi
69-
70- - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 0 ]; then vendor/bin/phpunit --verbose; fi
71- - if [ $TASK_TESTS == 1 ] && [ $TASK_TESTS_COVERAGE == 1 ]; then phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml; fi
72-
73- - if [ $TASK_SCA == 1 ]; then git checkout . -q; fi
74-
75- - if [ $TASK_CS == 1 ]; then php php-cs-fixer --diff --dry-run -v fix; fi
76-
77- after_success :
78- - if [ $TASK_TESTS_COVERAGE == 1 ]; then php vendor/bin/coveralls -v; fi
79-
80- before_deploy :
81- # install box2
82- - curl -LSs http://box-project.github.io/box2/installer.php | php
83- - php box.phar --version
84-
85- # ensure that deps will work on lowest supported PHP version
86- - composer config platform.php 2> /dev/null || composer config platform.php 5.6.0
87-
88- # require suggested packages
89- - composer require --no-update symfony/polyfill-mbstring
90-
91- # update deps to highest possible for lowest supported PHP version
92- - composer update $DEFAULT_COMPOSER_FLAGS --no-dev --prefer-stable
93-
94- - composer info -D | sort
95-
96- # build phar file
97- - php -d phar.readonly=false box.phar build
98-
99- deploy :
100- provider : releases
101- api_key :
102- secure : K9NKi7X1OPz898fxtVc1RfWrSI+4hTFFYOik932wTz1jC4dQJ64Khh1LV9frA1+JiDS3+R6TvmQtpzbkX3y4L75UrSnP1ADH5wfMYIVmydG3ZjTMo8SWQWHmRMh3ORAKTMMpjl4Q7EkRkLp6RncKe+FAFPP5mgv55mtIMaE4qUk=
103- file : php-cs-fixer.phar
104- skip_cleanup : true
105- on :
106- repo : FriendsOfPHP/PHP-CS-Fixer
107- tags : true
108- condition : $DEPLOY = yes
24+ jobs :
25+ include :
26+ -
27+ stage : Static Code Analysis
28+ php : 7.1
29+ env : COMPOSER_FLAGS="--no-dev --prefer-stable"
30+ install :
31+ - travis_retry composer update -d dev-tools $DEFAULT_COMPOSER_FLAGS
32+ - composer info -d dev-tools -D | sort
33+
34+ - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
35+ - composer info -D | sort
36+ before_script :
37+ - if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then COMMIT_RANGE=$TRAVIS_COMMIT_RANGE; else COMMIT_RANGE="HEAD~..HEAD"; fi;
38+ - export COMMIT_SCA_FILES=`git diff --name-only --diff-filter=ACMRTUXB $COMMIT_RANGE`
39+ script :
40+ - ./check_trailing_spaces.sh || travis_terminate 1
41+ - if [ -n "$COMMIT_SCA_FILES" ]; then ./dev-tools/vendor/bin/phpmd `echo "$COMMIT_SCA_FILES" | grep -Ev "^(src/Resources|tests/Fixtures)" | xargs | sed 's/ /,/g'` text phpmd.xml || travis_terminate 1; fi
42+ - ./dev-tools/vendor/bin/composer-require-checker check composer.json --config-file=.composer-require-checker.json
43+
44+
45+ - &STANDARD_TEST_JOB
46+ stage : Test
47+ php : 7.0
48+ install :
49+ - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
50+ - composer info -D | sort
51+ script :
52+ - vendor/bin/phpunit --verbose || travis_terminate 1
53+ - php php-cs-fixer --diff --dry-run -v fix
54+
55+ -
56+ << : *STANDARD_TEST_JOB
57+ php : 5.6
58+ env : COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
59+
60+ -
61+ << : *STANDARD_TEST_JOB
62+ php : 7.1
63+ env : COLLECT_COVERAGE=1
64+ before_script :
65+ # check phpdbg
66+ - phpdbg --version 2> /dev/null || { echo 'No phpdbg'; export COLLECT_COVERAGE=0; }
67+
68+ # for building a tag release we don't need to collect code coverage
69+ - if [ $TRAVIS_TAG ]; then export COLLECT_COVERAGE=0; fi
70+ script :
71+ - if [ $COLLECT_COVERAGE == 0 ]; then vendor/bin/phpunit --verbose || travis_terminate 1; fi
72+ - if [ $COLLECT_COVERAGE == 1 ]; then phpdbg -qrr vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml || travis_terminate 1; fi
73+ - php php-cs-fixer --diff --dry-run -v fix || travis_terminate 1
74+ - if [ $COLLECT_COVERAGE == 1 ]; then php vendor/bin/coveralls -v; fi
75+
76+ -
77+ << : *STANDARD_TEST_JOB
78+ php : nightly
79+ env : COMPOSER_FLAGS="--ignore-platform-reqs" SYMFONY_DEPRECATIONS_HELPER=weak PHP_CS_FIXER_IGNORE_ENV=1 PHP_CS_FIXER_TEST_USE_LEGACY_TOKENIZER=1
80+ script :
81+ - php php-cs-fixer fix --rules @PHP70Migration:risky,@PHP71Migration,native_function_invocation -q || travis_terminate 1
82+ - vendor/bin/phpunit --verbose || travis_terminate 1
83+ - git checkout . -q
84+ - php php-cs-fixer --diff --dry-run -v fix
85+
86+ -
87+ stage : Deployment
88+ php : 7.1
89+ env : COMPOSER_FLAGS="--no-dev --prefer-stable"
90+ install : skip
91+ script : skip
92+ before_deploy :
93+ # ensure that deps will work on lowest supported PHP version
94+ - composer config platform.php 2> /dev/null || composer config platform.php 5.6.0
95+
96+ # require suggested packages
97+ - composer require --no-update symfony/polyfill-mbstring
98+
99+ - travis_retry composer update $DEFAULT_COMPOSER_FLAGS $COMPOSER_FLAGS
100+ - composer info -D | sort
101+
102+ # install box2
103+ - curl -LSs http://box-project.github.io/box2/installer.php | php
104+ - php box.phar --version
105+
106+ # build phar file
107+ - php -d phar.readonly=false box.phar build
108+ deploy :
109+ provider : releases
110+ api_key :
111+ secure : K9NKi7X1OPz898fxtVc1RfWrSI+4hTFFYOik932wTz1jC4dQJ64Khh1LV9frA1+JiDS3+R6TvmQtpzbkX3y4L75UrSnP1ADH5wfMYIVmydG3ZjTMo8SWQWHmRMh3ORAKTMMpjl4Q7EkRkLp6RncKe+FAFPP5mgv55mtIMaE4qUk=
112+ file : php-cs-fixer.phar
113+ skip_cleanup : true
114+ on :
115+ repo : FriendsOfPHP/PHP-CS-Fixer
116+ tags : true
0 commit comments