Skip to content

Commit ee42061

Browse files
author
David Alger
committed
Updates to travis configuration file
- Turned apt caching on in travis builds - Configured to use copy of composer independent from build server This is done to overcome issues with composer self-update failing on connection to the composer site, and avoid the time needed to self-update on every build since we'll have the latest version cached - Timeout on composer install to prevent dying builds - Added call to composer --version so we will easily know what version is used (since default is not being used, travis call to this is inaccurate)
1 parent 84772ef commit ee42061

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ env:
1010
- TEST_SUITE=static_phpcs
1111
- TEST_SUITE=static_annotation
1212
cache:
13+
apt: true
1314
directories:
1415
- $HOME/.composer/cache
16+
- $HOME/.cache/bin
1517
matrix:
1618
exclude:
1719
- php: 5.6
@@ -21,7 +23,8 @@ matrix:
2123
before_install:
2224
- sudo apt-get update -qq
2325
- sudo apt-get install -y -qq postfix
24-
- composer self-update
26+
- sh -c "if [ -x $HOME/.cache/bin/composer ]; then $HOME/.cache/bin/composer self-update; echo ''; else mkdir -p $HOME/.cache/bin; curl --connect-timeout 30 -sS 'https://getcomposer.org/installer' | php -- --install-dir $HOME/.cache/bin/ --filename composer; fi"
27+
- $HOME/.cache/bin/composer --version
2528
before_script:
2629
# Mock mail
2730
- sudo service postfix stop
@@ -50,7 +53,7 @@ before_script:
5053
# Change memory_limit for travis
5154
- echo 'memory_limit = -1' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
5255
- phpenv rehash;
53-
- composer install --no-interaction --prefer-dist
56+
- $HOME/.cache/bin/composer install --no-interaction --prefer-dist
5457
script:
5558
# Unit tests
5659
- sh -c "if [ '$TEST_SUITE' = 'unit' ]; then ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist; fi"

0 commit comments

Comments
 (0)