Skip to content

Commit 8314342

Browse files
authored
Added travis file from symfony best practices (#8)
* Added travis file from symfony best practices * Added "lowest" test with PHP high and low
1 parent b9d4ab7 commit 8314342

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

.travis.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: php
2-
32
sudo: false
43

54
cache:
@@ -9,10 +8,6 @@ cache:
98
env:
109
global:
1110
- TEST_COMMAND="composer test"
12-
matrix:
13-
- SYMFONY_VERSION=3.0.*
14-
- SYMFONY_VERSION=2.8.*
15-
- SYMFONY_VERSION=2.7.*
1611

1712
branches:
1813
except:
@@ -21,35 +16,46 @@ branches:
2116
matrix:
2217
fast_finish: true
2318
include:
24-
# Test stable versions
19+
# Test with lowest dependencies
20+
- php: 7.1
21+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
22+
- php: 5.4
23+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
24+
25+
# Test the latest stable release
2526
- php: 5.4
26-
env: DEPENDENCIES=minimum COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_VERSION="2.7.* henrikbjorn/phpspec-code-coverage:^1.0"
2727
- php: 5.5
2828
- php: 5.6
2929
- php: 7.0
30-
31-
# Test latest versions:
32-
- php: 7.1
33-
env: DEPENDENCIES="symfony/lts:^3" SYMFONY_VERSION=3.0.*
3430
- php: 7.1
35-
env: DEPENDENCIES="dev" SYMFONY_VERSION=4.0.*
31+
- php: 7.2
32+
env: COVERAGE=true TEST_COMMAND="composer test-ci" DEPENDENCIES="henrikbjorn/phpspec-code-coverage:^1.0"
3633

37-
# Test alternative runtimes:
38-
- php: hhvm
34+
# Force some major versions of Symfony
35+
- php: 7.2
36+
env: DEPENDENCIES="dunglas/symfony-lock:^2"
37+
- php: 7.2
38+
env: DEPENDENCIES="dunglas/symfony-lock:^3"
39+
- php: 7.2
40+
env: DEPENDENCIES="dunglas/symfony-lock:^4"
41+
42+
# Latest commit to master
43+
- php: 7.2
44+
env: STABILITY="dev"
3945

4046
allow_failures:
41-
- php: 7.1
42-
env: DEPENDENCIES="dev" SYMFONY_VERSION=4.0.*
47+
# Dev-master is allowed to fail.
48+
- env: STABILITY="dev"
4349

4450
before_install:
45-
- travis_retry composer self-update
46-
- if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi;
47-
- if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi;
48-
- if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi;
51+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
52+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
53+
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
4954

5055
install:
51-
- travis_retry composer require symfony/symfony:${SYMFONY_VERSION} --no-update
52-
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
56+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
57+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
58+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
5359

5460
script:
5561
- composer validate --strict --no-check-lock

0 commit comments

Comments
 (0)