mirror of
https://github.com/macintoshplus/mongo-php-driver.git
synced 2026-04-27 18:43:14 +02:00
Add macOS environments to build matrix
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
|
||||
# https://github.com/eddyxu/cpp-coveralls#linux
|
||||
pip install --user cpp-coveralls
|
||||
fi
|
||||
|
||||
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
|
||||
brew update
|
||||
brew upgrade
|
||||
|
||||
brew tap homebrew/homebrew-php
|
||||
brew install "${PHP_VERSION}"
|
||||
|
||||
# http://brewformulas.org/Lcov
|
||||
brew install lcov
|
||||
|
||||
# https://github.com/eddyxu/cpp-coveralls#os-x
|
||||
brew install pyenv
|
||||
eval "$(pyenv init -)"
|
||||
pyenv install 2.7.6
|
||||
pyenv global 2.7.6
|
||||
pyenv rehash
|
||||
pip install cpp-coveralls
|
||||
pyenv rehash
|
||||
fi
|
||||
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
CONFIGURE_OPTS="--enable-developer-flags --enable-coverage"
|
||||
|
||||
if [ -n "${SSL_VERSION}" ]; then
|
||||
CONFIGURE_OPTS="${CONFIGURE_OPTS} --with-mongodb-ssl=${SSL_VERSION}"
|
||||
fi
|
||||
|
||||
phpize
|
||||
./configure ${CONFIGURE_OPTS}
|
||||
make all -j4
|
||||
make install
|
||||
|
||||
# Use latest run-tests.php, as older versions don't report a non-zero exit code for failures
|
||||
wget -O run-tests.php https://raw.githubusercontent.com/php/php-src/master/run-tests.php
|
||||
|
||||
# Add the extension to php.ini
|
||||
echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
|
||||
|
||||
# Predefine the test server
|
||||
echo '{"STANDALONE": "mongodb:\/\/127.0.0.1:27017"}' > /tmp/PHONGO-SERVERS.json
|
||||
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
trap abort_on_failure ERR
|
||||
|
||||
LCOV_VERSION=1.11
|
||||
|
||||
|
||||
abort_on_failure () {
|
||||
echo "Last command failed, exising"
|
||||
exit 42;
|
||||
}
|
||||
|
||||
build_lcov() {
|
||||
mkdir tmp-lcov
|
||||
pushd tmp-lcov
|
||||
wget -O lcov.tar.gz http://downloads.sourceforge.net/ltp/lcov-${LCOV_VERSION}.tar.gz
|
||||
tar zxf lcov.tar.gz --strip-components=1
|
||||
sudo make install
|
||||
popd
|
||||
}
|
||||
build_lcov
|
||||
|
||||
phpize
|
||||
./configure --enable-developer-flags --enable-coverage
|
||||
make all -j4
|
||||
sudo make install
|
||||
echo "Use the most-up-to-date run-tests.. old ones like 5.3 don't report failure exit codes"
|
||||
wget -O run-tests.php https://raw.githubusercontent.com/php/php-src/master/run-tests.php
|
||||
|
||||
|
||||
|
||||
rm -rf tmp-lcov tmp # coveralls may pick it up and lie about our coverage
|
||||
|
||||
echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
|
||||
|
||||
MONGO=`which mongo`
|
||||
mongod --version
|
||||
ls $MONGO*
|
||||
pwd
|
||||
|
||||
|
||||
# Predefine the test server
|
||||
echo '{"STANDALONE": "mongodb:\/\/127.0.0.1:27017"}' > /tmp/PHONGO-SERVERS.json
|
||||
+47
-11
@@ -1,10 +1,49 @@
|
||||
language: php
|
||||
php:
|
||||
- 7.2
|
||||
- 7.1
|
||||
- 7.0
|
||||
- 5.6
|
||||
- 5.5
|
||||
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- gdb
|
||||
- lcov
|
||||
|
||||
matrix:
|
||||
include:
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
php: 5.5
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
php: 5.6
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
php: 7.0
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
php: 7.1
|
||||
- os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
php: 7.2
|
||||
- os: osx
|
||||
osx_image: xcode8.3
|
||||
language: generic
|
||||
env:
|
||||
- PHP_VERSION: php56
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
language: generic
|
||||
env:
|
||||
- PHP_VERSION: php72
|
||||
- os: osx
|
||||
osx_image: xcode9.2
|
||||
language: generic
|
||||
env:
|
||||
- PHP_VERSION: php72
|
||||
- SSL_VERSION: darwin
|
||||
|
||||
services:
|
||||
- mongodb
|
||||
@@ -15,16 +54,13 @@ env:
|
||||
- REPORT_EXIT_STATUS=1
|
||||
|
||||
before_install:
|
||||
- sudo pip install --upgrade cpp-coveralls
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install gdb valgrind
|
||||
- sudo apt-get install cdbs debhelper build-essential python-lxml
|
||||
- .travis.scripts/before_install.sh
|
||||
- php -r 'if ( ! ($f = php_ini_loaded_file())) { $f = PHP_CONFIG_FILE_PATH . "/php.ini"; } file_put_contents($f, "variables_order=EGPCS\n", FILE_APPEND); $a = file($f, FILE_IGNORE_NEW_LINES); var_dump($a[count($a)-1]);'
|
||||
|
||||
before_script:
|
||||
- ulimit -a
|
||||
- ulimit -c unlimited || true
|
||||
- "./.travis.scripts/compile.sh"
|
||||
- .travis.scripts/before_script.sh
|
||||
|
||||
script:
|
||||
- make test
|
||||
|
||||
Reference in New Issue
Block a user