From 8fcefac455608e0f7dfc98ad6eb5de0f19990798 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 20 Nov 2019 12:51:21 +0100 Subject: [PATCH] Rework travis-ci config to test multiple Symfony versions --- .travis.yml | 74 +++++++++++++++++++++++++++++++++++---------------- composer.json | 1 + 2 files changed, 52 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2baf110..38f14377 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,34 +2,26 @@ 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 @@ -37,8 +29,44 @@ install: - 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 diff --git a/composer.json b/composer.json index 9a387229..a8d0b0d3 100644 --- a/composer.json +++ b/composer.json @@ -5,6 +5,7 @@ "keywords": ["persistence", "mongodb", "symfony"], "homepage": "http://www.doctrine-project.org", "license": "MIT", + "minimum-stability": "dev", "authors": [ {"name": "Bulat Shakirzyanov", "email": "mallluhuct@gmail.com"}, {"name": "Kris Wallsmith", "email": "kris@symfony.com"},