Skip to content

Commit acddcdd

Browse files
committed
Add macOS environments to build matrix
1 parent 6da5f63 commit acddcdd

File tree

4 files changed

+94
-53
lines changed

4 files changed

+94
-53
lines changed

.travis.scripts/before_install.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
4+
# https://github.com/eddyxu/cpp-coveralls#linux
5+
pip install --user cpp-coveralls
6+
fi
7+
8+
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
9+
brew update
10+
brew upgrade
11+
12+
brew tap homebrew/homebrew-php
13+
brew install "${PHP_VERSION}"
14+
15+
# http://brewformulas.org/Lcov
16+
brew install lcov
17+
18+
# https://github.com/eddyxu/cpp-coveralls#os-x
19+
brew install pyenv
20+
eval "$(pyenv init -)"
21+
pyenv install 2.7.6
22+
pyenv global 2.7.6
23+
pyenv rehash
24+
pip install cpp-coveralls
25+
pyenv rehash
26+
fi

.travis.scripts/before_script.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/sh
2+
3+
CONFIGURE_OPTS="--enable-developer-flags --enable-coverage"
4+
5+
if [ -n "${SSL_VERSION}" ]; then
6+
CONFIGURE_OPTS="${CONFIGURE_OPTS} --with-mongodb-ssl=${SSL_VERSION}"
7+
fi
8+
9+
phpize
10+
./configure ${CONFIGURE_OPTS}
11+
make all -j4
12+
make install
13+
14+
# Use latest run-tests.php, as older versions don't report a non-zero exit code for failures
15+
wget -O run-tests.php https://raw.githubusercontent.com/php/php-src/master/run-tests.php
16+
17+
# Add the extension to php.ini
18+
echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
19+
20+
# Predefine the test server
21+
echo '{"STANDALONE": "mongodb:\/\/127.0.0.1:27017"}' > /tmp/PHONGO-SERVERS.json

.travis.scripts/compile.sh

Lines changed: 0 additions & 42 deletions
This file was deleted.

.travis.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,49 @@
11
language: php
2-
php:
3-
- 7.2
4-
- 7.1
5-
- 7.0
6-
- 5.6
7-
- 5.5
2+
3+
addons:
4+
apt:
5+
packages:
6+
- gdb
7+
- lcov
8+
9+
matrix:
10+
include:
11+
- os: linux
12+
dist: trusty
13+
sudo: required
14+
php: 5.5
15+
- os: linux
16+
dist: trusty
17+
sudo: required
18+
php: 5.6
19+
- os: linux
20+
dist: trusty
21+
sudo: required
22+
php: 7.0
23+
- os: linux
24+
dist: trusty
25+
sudo: required
26+
php: 7.1
27+
- os: linux
28+
dist: trusty
29+
sudo: required
30+
php: 7.2
31+
- os: osx
32+
osx_image: xcode8.3
33+
language: generic
34+
env:
35+
- PHP_VERSION: php56
36+
- os: osx
37+
osx_image: xcode9.2
38+
language: generic
39+
env:
40+
- PHP_VERSION: php72
41+
- os: osx
42+
osx_image: xcode9.2
43+
language: generic
44+
env:
45+
- PHP_VERSION: php72
46+
- SSL_VERSION: darwin
847

948
services:
1049
- mongodb
@@ -15,16 +54,13 @@ env:
1554
- REPORT_EXIT_STATUS=1
1655

1756
before_install:
18-
- sudo pip install --upgrade cpp-coveralls
19-
- sudo apt-get update
20-
- sudo apt-get install gdb valgrind
21-
- sudo apt-get install cdbs debhelper build-essential python-lxml
57+
- .travis.scripts/before_install.sh
2258
- 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]);'
2359

2460
before_script:
2561
- ulimit -a
2662
- ulimit -c unlimited || true
27-
- "./.travis.scripts/compile.sh"
63+
- .travis.scripts/before_script.sh
2864

2965
script:
3066
- make test

0 commit comments

Comments
 (0)