-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-324: Cache extension installation for Travis CI jobs #493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ cache: | |
directories: | ||
- ${HOME}/.cache/pip | ||
- ${HOME}/.composer/cache/files | ||
- ${HOME}/php-ext | ||
|
||
env: | ||
global: | ||
|
@@ -46,11 +47,28 @@ before_install: | |
- mongod --version | ||
- mongo-orchestration --version | ||
- export MO_PATH=`python -c 'import mongo_orchestration; from os import path; print(path.dirname(mongo_orchestration.__file__));'` | ||
- | | ||
INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
# tpecl is a helper to compile and cache php extensions | ||
tpecl () { | ||
local ext_name=$1 | ||
local ext_so=$2 | ||
local ext_dir=$(php -r "echo ini_get('extension_dir');") | ||
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name | ||
if [[ -e $ext_cache/$ext_so ]]; then | ||
echo extension = $ext_cache/$ext_so >> $INI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This depends on an |
||
else | ||
mkdir -p $ext_cache | ||
echo yes | pecl install -f $ext_name && | ||
cp $ext_dir/$ext_so $ext_cache | ||
fi | ||
} | ||
export -f tpecl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Calling
|
||
|
||
before_script: | ||
- mongo-orchestration start | ||
- pushd ${MO_PATH} && ${TRAVIS_BUILD_DIR}/.travis/mo.sh configurations/servers/clean.json start && popd | ||
- pecl install -f mongodb-${DRIVER_VERSION} | ||
- tpecl mongodb-${DRIVER_VERSION} mongodb.so | ||
- php --ri mongodb | ||
- composer install --no-interaction --no-progress --no-suggest | ||
- ulimit -c | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I missed this earlier but we'll also need to add
php-ext
to the list of cached directories further up in the Travis config. See: https://github.com/symfony/symfony/blob/32cc2e06a326b1dd888c02e1cc48988a14cb9a65/.travis.yml#L35. The following should suffice: