Skip to content

Commit

Permalink
Add PHP 7.1 and MongoDB 3.2 to the build matrix
Browse files Browse the repository at this point in the history
With the old matrix, we'd have 10 builds, which seems excessive. Since there's no need to test every PHP version against every MongoDB version, we only test PHP 5.6 against each MongoDB version.
  • Loading branch information
alcaeus committed Dec 29, 2016
1 parent e370385 commit 7c6d1ac
Showing 1 changed file with 30 additions and 12 deletions.
42 changes: 30 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,38 @@ language: php

php:
- 5.6
- 7.0
- 7.1

env:
global:
- DOCTRINE_MONGODB_SERVER=mongodb://localhost:27017
matrix:
- MONGO_VERSION=1.5.8
- MONGO_VERSION=stable
- DOCTRINE_MONGODB_SERVER="mongodb://localhost:27017"
- KEY_SERVER="hkp://keyserver.ubuntu.com:80"
- MONGO_REPO_URI="https://repo.mongodb.com/apt/ubuntu"
- MONGO_REPO_TYPE="precise/mongodb-enterprise/"
- SOURCES_LOC="/etc/apt/sources.list.d/mongodb.list"
- DRIVER_VERSION="stable"
- ADAPTER_VERSION="^1.0.0"
- SERVER_VERSION="3.2"

matrix:
include:
- php: 7.0
env: ADAPTER_VERSION="^1.0.0" MONGODB_VERSION=stable


services: mongodb
- php: 5.6
env: DRIVER_VERSION="1.5.8" SERVER_VERSION="2.6" COMPOSER_FLAGS="--prefer-lowest"
- php: 5.6
env: DRIVER_VERSION="stable" SERVER_VERSION="3.0"

before_install:
- sudo apt-key adv --keyserver ${KEY_SERVER} --recv 7F0CEB10
- sudo apt-key adv --keyserver ${KEY_SERVER} --recv EA312927
- echo "deb ${MONGO_REPO_URI} ${MONGO_REPO_TYPE}${SERVER_VERSION} multiverse" | sudo tee ${SOURCES_LOC}
- sudo apt-get update -qq

install:
- sudo apt-get install mongodb-enterprise
- if nc -z localhost 27017; then sudo service mongod stop; fi
- sudo pip install mongo-orchestration
- sudo mongo-orchestration start

before_script:
- if [ "x${MONGO_VERSION}" != "x" ]; then yes '' | pecl -q install -f mongo-${MONGO_VERSION} && echo "extension=mongo.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
Expand All @@ -25,9 +42,10 @@ before_script:
- sudo mongo-orchestration start
- curl -XPUT http://localhost:8889/v1/sharded_clusters/myCluster --data @tests/sharded.json | python -m json.tool
- composer self-update
- if [ "x${MONGODB_VERSION}" != "x" ]; then pecl install -f mongodb-${MONGODB_VERSION}; fi
- if [ "x${ADAPTER_VERSION}" != "x" ]; then composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}" --ignore-platform-reqs; fi
- composer install --dev
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "5." ]]; then yes '' | pecl -q install -f mongo-${DRIVER_VERSION}; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then pecl install -f mongodb-${DRIVER_VERSION}; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then composer require "alcaeus/mongo-php-adapter=${ADAPTER_VERSION}" --ignore-platform-reqs; fi
- composer update ${COMPOSER_FLAGS}

script:
- ./vendor/bin/phpunit --coverage-clover=coverage.clover
Expand Down

0 comments on commit 7c6d1ac

Please sign in to comment.