Skip to content
This repository has been archived by the owner on Mar 30, 2018. It is now read-only.

Improve Travis matrix #207

Merged
merged 14 commits into from
Apr 21, 2017
40 changes: 24 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@
language: php
sudo: false

php:
- 7.0
- 5.6
- 5.5
- 5.4
- hhvm
- hhvm-nightly

matrix:
include:
- php: 5.4
Copy link
Collaborator

Choose a reason for hiding this comment

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

Per #226, we can remove the EOL php versions 5.3 to 5.5.

env: COMPOSER_FLAGS='--prefer-lowest'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be simpler to just add an env block later? e.g.

env:
  matrix:
    - COMPOSER_FLAGS="--prefer-lowest"
    - COMPOSER_FLAGS=""

Keeps the list of flags and versions distinct?

- php: 5.4
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 you can skip the flags here as it's the default behaviour

- php: 5.5
env: COMPOSER_FLAGS='--prefer-lowest'
- php: 5.5
- php: 5.6
env: COMPOSER_FLAGS='--prefer-lowest'
- php: 5.6
Copy link
Member

Choose a reason for hiding this comment

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

versions should be strings

- php: 7.0
env: COMPOSER_FLAGS='--prefer-lowest'
- php: 7.0
- php: 7.1
env: COMPOSER_FLAGS='--prefer-lowest'
- php: 7.1
Copy link
Member

Choose a reason for hiding this comment

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

we're missing a nightly build that should be allowed to fail

env:
- TEST_COVERAGE=true
- php: hhvm
env: COMPOSER_FLAGS='--prefer-lowest'
- php: hhvm
fast_finish: true
allow_failures:
- php: 7.0
- php: hhvm
- php: hhvm-nightly
Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no hhvm-nightly build now :)


branches:
only:
- master
Expand All @@ -24,12 +35,9 @@ cache:
directories:
- $HOME/.composer/cache

before_install:
- travis_retry composer self-update

before_script:
- travis_retry composer install --no-interaction
- composer update --no-interaction --prefer-source $COMPOSER_FLAGS
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there some reason to put --prefer-source here? Installing source packages takes more time than dist ones.


script:
- vendor/bin/phpunit --coverage-text
- if [[ $TEST_COVERAGE == 'true' ]]; then vendor/bin/phpunit --coverage-text ; else vendor/bin/phpunit ; fi
Copy link
Member

Choose a reason for hiding this comment

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

if [ -n "$TEST_COVERAGE" ]; then?

Copy link
Member

Choose a reason for hiding this comment

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

Single brackets are also enough AFAIK

Copy link
Collaborator

Choose a reason for hiding this comment

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

What do you think about introducing $PHPUNIT_FLAGS? This way we can remove if from this statement.

- vendor/bin/behat