Skip to content

Reduced the number of travis builds. #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Apr 24, 2017
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ php:
- hhvm

env:
global:
- TEST_COMMAND="composer test"
matrix:
- SYMFONY_VERSION=3.2.*
- SYMFONY_VERSION=3.1.*
- SYMFONY_VERSION=2.8.*
- SYMFONY_VERSION=2.8.* TEST_COMMAND="composer test"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would by default not enforce any Symfony version at all. And by the way, 2.8 should be handled fine by the job using the --prefer-lowest flag.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to do one by default. Otherwise composer require symfony/symfony: will fail, right?

I used 2.8 because it is the only LTS we support.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh well, I would run composer require symfony/symfony only if $SYMFONY_VERSION is defined and not empty.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okey, but that would be the same as setting SYMFONY_VERSION=3.2.*

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe also set minimum-stability in the composer.json file to dev so that you would get a build with the latest Symfony development version for free ("normal" builds could use the --prefer-stable flag).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing against Symfony 3.3 would be nice. We just have to allow it to fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nyholm it is not the same than setting SYMFONY_VERSION=3.2.*:

  • it runs tests using the unmodified composer.json, ensuring that your composer.json has the necessary requirement (remove the symfony requirement currently, and you won't see any failure on Travis as it will always re-add one)
  • it runs tests against the latest stable version of Symfony, without requiring you to update the version every 6 months.

My own rule for the Travis matrix is this one:

  • unmodified composer.json for normal jobs (on different PHP version)
  • extra jobs for supported LTS branches of Symfony
  • an extra job checking lowest deps (and without changing the Symfony requirement, otherwise this one is not validated)
  • an extra job changing the minimum-stability to dev, to ensure compatibility with the upcoming dev version (this one may be allowed to fail depending on your policy)

With such config, I only need to change the build matrix when the list of supported LTS versions is changing (every 2 years)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the approach @stof recommends.


branches:
except:
Expand All @@ -30,6 +25,10 @@ matrix:
include:
- php: 5.5
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_VERSION=2.8.*
- php: 7.1
env: SYMFONY_VERSION=3.2.*
- php: 7.1
env: SYMFONY_VERSION=3.1.*

install:
- composer require symfony/symfony:${SYMFONY_VERSION} --no-update
Expand Down