forked from symfony/demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (54 loc) · 2.28 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
language: php
sudo: false
cache:
yarn: true
directories:
- $HOME/.composer/cache/files
- ./bin/.phpunit
env:
global:
- SYMFONY_PHPUNIT_DIR=./bin/.phpunit
- SYMFONY_DEPRECATIONS_HELPER=9
- ACTION="install"
matrix:
fast_finish: true
include:
- php: 7.2
- php: 7.3
env: SYMFONY="5.0.*"
ACTION="update"
- php: 7.4
before_install:
- '[[ "$TRAVIS_PHP_VERSION" == "7.4snapshot" ]] || phpenv config-rm xdebug.ini'
- composer self-update
# Set memory to max (memory fail)
- '[[ "$ACTION" == "install" ]] || echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini'
# Set stability to dev to allow 4.4dev and 5.0dev
- '[[ "$ACTION" == "install" ]] || composer config minimum-stability dev'
# Change version of symfony when need
- '[[ "$ACTION" == "install" ]] || composer config extra.symfony.require $SYMFONY'
install:
- php -r "echo ini_get('memory_limit').PHP_EOL;"
# install or update
- composer $ACTION
- ./bin/phpunit install
script:
- ./bin/phpunit
# this checks that the source code follows the Symfony Code Syntax rules
- '[[ "$TRAVIS_PHP_VERSION" == "7.4" ]] || ./vendor/bin/php-cs-fixer fix --diff --dry-run -v'
# this checks that the YAML config files contain no syntax errors
- ./bin/console lint:yaml config --parse-tags
# this checks that the Twig template files contain no syntax errors
- ./bin/console lint:twig templates --env=prod
# this checks that the XLIFF translations contain no syntax errors
- ./bin/console lint:xliff translations
# this checks that arguments injected into services match type declarations
- ./bin/console lint:container
# TODO: replace the old security checker by the new checker provided by the 'symfony' binary
# this checks that the application doesn't use dependencies with known security vulnerabilities
#- ./bin/console security:check
# this checks that Doctrine's mapping configurations are valid
- ./bin/console doctrine:schema:validate --skip-sync -vvv --no-interaction
# Fail CI if the repo is in a dirty state after building assets (only for current release ie install)
#- if [[ "$ACTION" == "install" ]]; then yarn install && yarn encore production && git add --all && git diff --staged --exit-code; fi
- composer validate