Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit be33472

Browse files
Improve travis checks so same steps are not run twice unnecessary
1 parent d729771 commit be33472

1 file changed

Lines changed: 59 additions & 23 deletions

File tree

.travis.yml

Lines changed: 59 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,73 @@ php:
1212
- nightly
1313

1414
env:
15-
- DEPENDENCIES=no
16-
- DEPENDENCIES=beta
17-
- DEPENDENCIES=low
18-
- SYMFONY_VERSION=2.7.*
19-
- SYMFONY_VERSION=2.8.*
20-
- SYMFONY_VERSION=3.0.*
21-
- SYMFONY_VERSION=3.1.*
22-
- SYMFONY_VERSION=3.2.*
23-
- SYMFONY_VERSION=3.3.*
24-
- SYMFONY_VERSION=3.4.*
25-
- SYMFONY_VERSION=4.0.*
15+
global:
16+
- LATEST_PHP_VERSION="7.2"
17+
matrix:
18+
- DEPENDENCIES="beta"
19+
- DEPENDENCIES="low"
20+
- DEPENDENCIES="stable"
21+
- SYMFONY_VERSION="2.8.*"
22+
- SYMFONY_VERSION="3.0.*"
23+
- SYMFONY_VERSION="3.1.*"
24+
- SYMFONY_VERSION="3.2.*"
25+
- SYMFONY_VERSION="3.3.*"
26+
- SYMFONY_VERSION="3.4.*"
27+
- SYMFONY_VERSION="4.0.*"
28+
- SYMFONY_VERSION="4.1.*"
29+
- SYMFONY_VERSION="dev-master"
2630

2731
matrix:
32+
fast_finish: true
2833
allow_failures:
2934
- php: nightly
30-
- env: DEPENDENCIES=beta
31-
- env: DEPENDENCIES=low
35+
- env: DEPENDENCIES="beta"
36+
- env: DEPENDENCIES="low"
37+
- env: SYMFONY_VERSION="dev-master"
38+
3239

3340
before_install:
34-
- composer self-update
35-
# Set composer minimum-stability configuration filter to beta versions
36-
- if [ "$DEPENDENCIES" = "beta" ]; then perl -pi -e 's/^}$/,"minimum-stability":"beta"}/' composer.json; fi;
37-
# Disable xdebug, there is no use of it being enabled
38-
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini{,.disabled} || echo "xdebug not available"
39-
# Prevent Travis throwing an out of memory error
4041
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
41-
# Test if we have a token for github as the project may hit the 60 rph limit
42-
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
42+
- if [ -n "$GH_TOKEN" ]; then
43+
composer config github-oauth.github.com ${GH_TOKEN};
44+
fi;
45+
- mkdir -p build/logs
4346

4447
install:
45-
- if [ "$DEPENDENCIES" = "low" ]; then composer --prefer-lowest --prefer-stable update; else composer update; fi;
48+
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
49+
composer remove friendsofphp/php-cs-fixer phpstan/phpstan --dev;
50+
fi
51+
- if [ "$DEPENDENCIES" = "beta" ]; then
52+
composer config minimum-stability beta;
53+
composer update -n --prefer-dist;
54+
elif [ "$DEPENDENCIES" = "low" ]; then
55+
composer update -n --prefer-dist --prefer-lowest;
56+
else
57+
composer update -n --prefer-dist;
58+
fi;
4659

4760
script:
48-
- composer validate-files
61+
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
62+
echo "File validation is skipped for older PHP versions";
63+
else
64+
composer validate-files;
65+
fi;
66+
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
67+
echo "Static analysis is skipped for older PHP versions";
68+
else
69+
composer run-static-analysis;
70+
fi;
71+
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
72+
echo "Code style check is skipped for older PHP versions";
73+
else
74+
composer check-code-style;
75+
fi;
76+
- if [ "$(phpenv version-name)" != "$LATEST_PHP_VERSION" ]; then
77+
echo "Security check is skipped for older PHP versions";
78+
else
79+
composer check-security;
80+
fi;
81+
- composer run-tests-with-clover
82+
83+
after_script:
84+
- bin/php-coveralls -v

0 commit comments

Comments
 (0)