1
+ # Ensure that PHP is installed in Travis' build environment. Travis provides several versions of
2
+ # PHP like 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, etc., each of them including XDebug and PHPUnit.
1
3
language : php
2
4
5
+ # Travis can cache content between builds. This speeds up the build process and saves resources.
3
6
cache :
4
7
yarn : true
5
8
directories :
9
+ # Cache composer packages so "composer install" is faster.
6
10
- $HOME/.composer/cache/files
11
+ # Cache the directory where Symfony stores its slightly modified version of PHPUnit.
7
12
- ./bin/.phpunit
13
+ # Cache the Symfony binary's directory so that it does not have to be reinstalled.
14
+ - $HOME/.symfony
8
15
9
16
env :
10
17
global :
18
+ # Symfony's PHPUnit bridge provides a modified version of PHPUnit. The modified PHPUnit is
19
+ # written to a directory that can be configured by the SYMFONY_PHPUNIT_DIR env var, or in
20
+ # the same directory as the simple-phpunit if it is not provided. It's also possible to set
21
+ # this env var in the phpunit.xml.dist file.
11
22
- SYMFONY_PHPUNIT_DIR=./bin/.phpunit
12
23
- SYMFONY_DEPRECATIONS_HELPER=9
13
24
- ACTION="install"
25
+ # Add the Symfony binary's path to PATH.
26
+ - PATH="$HOME/.symfony/bin:$PATH"
14
27
28
+ # Defines all jobs which Travis will run in parallel. For each PHP version we support we will run one job.
15
29
matrix :
30
+ # With fast finishing enabled, Travis CI will mark your build as finished as soon as one of two
31
+ # conditions are met: The only remaining jobs are allowed to fail, or a job has already failed. In
32
+ # these cases, the status of the build can already be determined, so there’s no need to wait around
33
+ # until the other jobs finish.
16
34
fast_finish : true
17
35
include :
18
36
- php : 7.2
@@ -23,39 +41,39 @@ matrix:
23
41
24
42
before_install :
25
43
- ' [[ "$TRAVIS_PHP_VERSION" == "7.4snapshot" ]] || phpenv config-rm xdebug.ini'
26
- - composer self-update
27
- # Set memory to max (memory fail)
44
+ # Set memory to max (memory fail).
28
45
- ' [[ "$ACTION" == "install" ]] || echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini'
29
- # Set stability to dev to allow 4.4dev and 5.0dev
46
+ # Set stability to dev to allow 4.4dev and 5.0dev.
30
47
- ' [[ "$ACTION" == "install" ]] || composer config minimum-stability dev'
31
- # Change version of symfony when need
48
+ # Change version of symfony when need.
32
49
- ' [[ "$ACTION" == "install" ]] || composer config extra.symfony.require $SYMFONY'
50
+ # If it is available update the Symfony binary, if not install it.
51
+ - if symfony self:version; then symfony self:update ; else wget https://get.symfony.com/cli/installer -O - | bash ; fi
33
52
34
53
install :
35
54
- php -r "echo ini_get('memory_limit').PHP_EOL;"
36
- # install or update
55
+ # Install or update Composer packages including dev dependencies listed in require-dev.
37
56
- composer $ACTION
38
57
- ./bin/phpunit install
39
58
40
59
script :
41
- # there 's no need to load data fixtures before running tests because the project
42
- # repository already includes a test database with all the fixtures needed to run the tests
60
+ # There 's no need to load data fixtures before running tests because the project
61
+ # repository already includes a test database with all the fixtures needed to run the tests.
43
62
- ./bin/phpunit
44
- # this checks that the source code follows the Symfony Code Syntax rules
63
+ # This checks that the source code follows the Symfony Code Syntax rules.
45
64
- ' [[ "$TRAVIS_PHP_VERSION" == "7.4" ]] || ./vendor/bin/php-cs-fixer fix --diff --dry-run -v'
46
- # this checks that the YAML config files contain no syntax errors
65
+ # This checks that the YAML config files contain no syntax errors.
47
66
- ./bin/console lint:yaml config --parse-tags
48
- # this checks that the Twig template files contain no syntax errors
67
+ # This checks that the Twig template files contain no syntax errors.
49
68
- ./bin/console lint:twig templates --env=prod
50
- # this checks that the XLIFF translations contain no syntax errors
69
+ # This checks that the XLIFF translations contain no syntax errors.
51
70
- ./bin/console lint:xliff translations
52
- # this checks that arguments injected into services match type declarations
71
+ # This checks that arguments injected into services match type declarations.
53
72
- ./bin/console lint:container
54
- # TODO: replace the old security checker by the new checker provided by the 'symfony' binary
55
- # this checks that the application doesn't use dependencies with known security vulnerabilities
56
- # - ./bin/console security:check
57
- # this checks that Doctrine's mapping configurations are valid
73
+ # This checks that the application doesn't use dependencies with known security vulnerabilities.
74
+ - symfony check:security
75
+ # This checks that Doctrine's mapping configurations are valid.
58
76
- ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction
59
- # Fail CI if the repo is in a dirty state after building assets (only for current release ie install)
77
+ # Fail CI if the repo is in a dirty state after building assets (only for current release ie install).
60
78
# - if [[ "$ACTION" == "install" ]]; then yarn install && yarn encore production && git add --all && git diff --staged --exit-code; fi
61
79
- composer validate --strict
0 commit comments