Skip to content

Commit

Permalink
Rework travis-ci config to test multiple Symfony versions
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed Nov 26, 2019
1 parent 5c5084a commit 8fcefac
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 23 deletions.
74 changes: 51 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,71 @@ dist: xenial
language: php
sudo: false

cache:
directories:
- $HOME/.composer/cache

php:
- 7.2
- 7.3
- 7.4snapshot

services: mongodb

env:
global:
- DRIVER_VERSION="stable"
- COMPOSER_FLAGS="--prefer-dist"

jobs:
include:
# Test against lowest dependencies with coverage
- stage: Test
php: 7.2
env: DRIVER_VERSION="1.5.0" COMPOSER_FLAGS="--prefer-dist --prefer-lowest" PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
- COMPOSER_FLAGS=" -n --prefer-dist --prefer-stable"
- COMPOSER_MEMORY_LIMIT=-1

- stage: Code Quality
php: 7.2
env: DRIVER_VERSION="stable" COMPOSER_FLAGS="--prefer-dist"
script:
- vendor/bin/phpcs

cache:
directories:
- $HOME/.composer/cache

services: mongodb
before_install:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
- composer global require --no-update --no-progress --no-scripts --no-plugins symfony/flex dev-master

install:
- composer self-update
- pecl install -f mongodb-${DRIVER_VERSION}
- composer update ${COMPOSER_FLAGS}

script:
- ./vendor/bin/phpunit ${PHPUNIT_FLAGS}
- ./vendor/bin/phpunit ${PHPUNIT_FLAGS}

jobs:
include:
# Tests the lowest set of dependencies
- php: 7.2
env: LOWEST DRIVER_VERSION="1.5.0" SYMFONY_DEPRECATIONS_HELPER=weak COMPOSER_FLAGS=" -n --prefer-lowest --prefer-stable --prefer-dist"

# Test against latest Symfony 3.4 stable
- php: 7.3
env: SYMFONY_REQUIRE="3.4.*"

# Test against latest Symfony 4.3 stable
- php: 7.3
env: SYMFONY_REQUIRE="4.3.*"

# Test against latest Symfony 4.4 dev
- php: 7.3
env: SYMFONY_REQUIRE="4.4.*"

# Test against latest Symfony 5.0 dev
- php: 7.3
env: SYMFONY_REQUIRE="5.0.*"

# Test dev versions
- php: 7.3
if: type = cron
env: DEV COMPOSER_FLAGS="-n --prefer-dist"

- stage: Code Quality
env: CODING_STANDARDS
php: 7.2
script:
- ./vendor/bin/phpcs

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- stage: Coverage
php: 7.3
env: COVERAGE PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
before_script:
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{.disabled,}
- if [[ ! $(php -m | grep -si xdebug) ]]; then echo "xdebug required for coverage"; exit 1; fi
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"keywords": ["persistence", "mongodb", "symfony"],
"homepage": "http://www.doctrine-project.org",
"license": "MIT",
"minimum-stability": "dev",
"authors": [
{"name": "Bulat Shakirzyanov", "email": "[email protected]"},
{"name": "Kris Wallsmith", "email": "[email protected]"},
Expand Down

0 comments on commit 8fcefac

Please sign in to comment.