]>
Commit | Line | Data |
---|---|---|
1 | language: php | |
2 | ||
3 | services: | |
4 | - mysql | |
5 | - postgresql | |
6 | - rabbitmq | |
7 | - redis | |
8 | ||
9 | # cache vendor dirs | |
10 | cache: | |
11 | apt: true | |
12 | directories: | |
13 | - vendor | |
14 | - $HOME/.composer/cache | |
15 | - node_modules | |
16 | - $HOME/.npm | |
17 | - $HOME/.yarn-cache | |
18 | ||
19 | if: | | |
20 | type = pull_request OR \ | |
21 | branch = master | |
22 | ||
23 | php: | |
24 | - 7.1 | |
25 | - 7.2 | |
26 | - 7.3 | |
27 | - 7.4 | |
28 | ||
29 | node_js: | |
30 | - "5" | |
31 | ||
32 | env: | |
33 | - DB=mysql | |
34 | - DB=pgsql | |
35 | - DB=sqlite | |
36 | ||
37 | matrix: | |
38 | fast_finish: true | |
39 | include: | |
40 | - php: 7.3 | |
41 | env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite | |
42 | allow_failures: | |
43 | - php: 7.4 | |
44 | ||
45 | # exclude v1 branches | |
46 | branches: | |
47 | except: | |
48 | - legacy | |
49 | ||
50 | before_install: | |
51 | - if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi; | |
52 | ||
53 | install: | |
54 | - if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.10; fi; | |
55 | - if [[ $ASSETS = build ]]; then npm install -g yarn@latest; fi; | |
56 | - if [[ $ASSETS = build ]]; then yarn install; fi; | |
57 | ||
58 | before_script: | |
59 | - PHP=$TRAVIS_PHP_VERSION | |
60 | - echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | |
61 | - phpenv config-rm xdebug.ini || echo "xdebug not available" | |
62 | - composer self-update --no-progress | |
63 | # install imagick | |
64 | - pear config-set preferred_state beta | |
65 | - pecl channel-update pecl.php.net | |
66 | - yes | pecl install imagick | |
67 | ||
68 | script: | |
69 | - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist | |
70 | ||
71 | - echo "travis_fold:start:prepare" | |
72 | - make prepare DB=$DB | |
73 | - echo "travis_fold:end:prepare" | |
74 | ||
75 | - make fixtures | |
76 | ||
77 | - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi; | |
78 | # PHPStan needs PHPUnit to be installed and cache app to be generated | |
79 | - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then php bin/phpstan analyse src tests --no-progress --level 1 ; fi; | |
80 | - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix --verbose --dry-run ; fi; | |
81 | - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi; | |
82 | - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml app/Resources/CraueConfigBundle/translations -v ; fi; | |
83 | - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/UserBundle/Resources/translations -v ; fi; | |
84 | - if [[ $ASSETS = build ]]; then yarn run build:prod; fi; |