-
Notifications
You must be signed in to change notification settings - Fork 49
/
.travis.yml
88 lines (76 loc) · 3.29 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
dist: trusty # fix for travis not updating their HHVM images
language: php
php:
- 5.6.37
- 7.0.32
- 7.1.18
- 7.2
- nightly
# only build master branch (and PRs)
branches:
only:
- "master"
cache:
directories:
- $HOME/.composer/cache/files
before_install:
# disable XDEBUG unless specified to be used
- sh -c 'if [ "${WITH_XDEBUG}" = "false" ]; then phpenv config-rm xdebug.ini && echo "xdebug disabled" || exit 0; fi'
install:
- composer update
- sh -c 'if [ "${TEST_FRAMEWORK}" != "" ]; then composer global require fxp/composer-asset-plugin; fi'
script:
# run tests when phpcs is not enabled
- if [[ "${RUN_PHPUNIT}" != "false" ]]; then
export RUN_PHPUNIT="true";
fi
- sh -c 'if [ "${PHPCS}" = "true" ]; then export RUN_PHPUNIT=false; fi'
- sh -c 'if [ "${RUN_PHPUNIT}" = "true" ]; then ./vendor/bin/phpunit -c ./phpunit.xml; fi'
- sh -c 'if [ "${RUN_PHPUNIT}" = "true" ]; then ./vendor/bin/phpunit -c ./phpunit-recovery.xml; fi'
# run phpcs when enabled
- sh -c 'if [ "${PHPCS}" = "true" ]; then ./vendor/bin/phpcs --standard=./phpcs.xml -n ./src/ && echo "PHPCS OK"; fi'
# run framework tests when enabled
- if [[ "${TEST_FRAMEWORK}" != "" ]]; then
if [[ "${TRAVIS_PULL_REQUEST}" = false ]]; then
git fetch --unshallow;
php framework-test.php dev-${TRAVIS_BRANCH} && echo "Framework integration OK";
elif [[ "${TRAVIS_PULL_REQUEST_BRANCH}" != "" ]]; then
php framework-test.php dev-${TRAVIS_PULL_REQUEST_BRANCH} && echo "Framework integration OK";
fi
fi
# check coverage if report was generated (requires xdebug enabled)
- sh -c 'if [ -e clover.xml ]; then php coverage-checker.php clover.xml 70; fi'
after_script:
- |
if [ "${WITH_XDEBUG}" = "true" ]; then
wget https://scrutinizer-ci.com/ocular.phar &&
php ocular.phar code-coverage:upload --format=php-clover clover.xml
fi
- |
if [ "${WITH_XDEBUG}" = "true" ]; then
vendor/bin/coveralls
fi
notifications:
slack:
secure: fwLiJFbxPCyY6+REN3XZ06RlffSVua3tW5Ih/p4xwp2KXNdcCldWCmziVhf65JGYaRU20M4HEOOcD+IpOI/IjpNHjF/+6OmtUGfkT9OfDCmuElqyq8UT6ck+xfb7FVtK42zkx0U3xC1qCclbFjY1Rht7vt5VnGN7Q3qJ3ax7mcM=
env:
global:
- BLOCKTRAIL_SDK_THROTTLE_BTCCOM=0.01
- secure: d4a4n3bdFO/TZGBnEO0zOarL7kTkh4WyH6U+sEQoqe7Wbs1OIN014JXqYZZn2TDQ8kKjxKGi63TiDvh2wvKF+B7dlOo3/WvqNOEA48eVmRI3/LQsAAcmUNIK6YnBN2YgIy0kl8ycDvx0W7hK/A6FFmbnGTJnG6vnQ5NmBe1G3ug=
- secure: ndOLTmYQgNKnr4qXt9/1TjYUDuGFn7K/v5L4urwIAxwD1jJYLHpntvhjTehQq34VX2uIQeDn0Zd4qyorpJxTI5Pmow51j5ZmtA0lS8TaFTwfWc+GZIG7UT3vcoHC5U0o54KJAlumSSncTMttPPfYsD7+8+8KYEjrOlXg6djq5fI=
# BLOCKTRAIL_SDK_BTCCOM_API_ENDPOINT
- secure: "hJDN/XyeCJVi86R08zPN/xpI/7U+SU6tWmfnVp4wF6cyZmdDY6UztSa5FaS/RRh0mF2M66PoW00VxyoZ7dj0avZrZWwILYdBpwiIWCg2Ay7rkBGbE/kiWuMfOAVpf8x3zO/ArunJC7spiWW+amTFxk0sutkz84bLxyQahsPmVgE="
matrix:
- PHPCS=false WITH_XDEBUG=false # default disable phpcs run and disable xdebug
matrix:
exclude:
# exclude the php7.0 job without xdebug so we can add one with xdebug
- php: 7.2
env: PHPCS=false WITH_XDEBUG=false
include:
# php7.2 run with xdebug for code coverage (slooooow)
- php: 7.2
env: PHPCS=false WITH_XDEBUG=true
# php7.2 run with phpcs (won't run tests, only phpcs)
- php: 7.2
env: PHPCS=true WITH_XDEBUG=false