]>
Commit | Line | Data |
---|---|---|
1 | language: php | |
2 | ||
3 | services: | |
4 | - rabbitmq | |
5 | - redis | |
6 | ||
7 | # used for HHVM | |
8 | addons: | |
9 | apt: | |
10 | packages: | |
11 | - tidy | |
12 | ||
13 | # cache vendor dirs | |
14 | cache: | |
15 | apt: true | |
16 | directories: | |
17 | - vendor | |
18 | - $HOME/.composer/cache | |
19 | - node_modules | |
20 | - $HOME/.npm | |
21 | - $HOME/.yarn-cache | |
22 | ||
23 | php: | |
24 | - 5.6 | |
25 | - 7.0 | |
26 | - 7.1 | |
27 | - 7.2 | |
28 | - nightly | |
29 | ||
30 | node_js: | |
31 | - "5" | |
32 | ||
33 | env: | |
34 | - DB=mysql | |
35 | - DB=pgsql | |
36 | - DB=sqlite | |
37 | ||
38 | matrix: | |
39 | fast_finish: true | |
40 | include: | |
41 | - php: 7.0 | |
42 | env: CS_FIXER=run VALIDATE_TRANSLATION_FILE=run ASSETS=build DB=sqlite | |
43 | allow_failures: | |
44 | - php: nightly | |
45 | ||
46 | # exclude v1 branches | |
47 | branches: | |
48 | except: | |
49 | - legacy | |
50 | ||
51 | before_install: | |
52 | - if [[ $TRAVIS_REPO_SLUG = wallabag/wallabag ]]; then cp .composer-auth.json ~/.composer/auth.json; fi; | |
53 | ||
54 | install: | |
55 | - if [[ $ASSETS = build ]]; then source ~/.nvm/nvm.sh && nvm install 6.10; fi; | |
56 | - if [[ $ASSETS = build ]]; then npm install -g yarn@latest; fi; | |
57 | - if [[ $ASSETS = build ]]; then yarn install; fi; | |
58 | ||
59 | before_script: | |
60 | - PHP=$TRAVIS_PHP_VERSION | |
61 | - if [[ ! $PHP = hhvm* ]]; then echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; fi; | |
62 | # xdebug isn't enable for PHP 7.1 | |
63 | - if [[ ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi | |
64 | - composer self-update --no-progress | |
65 | - if [[ $DB = pgsql ]]; then psql -c 'create database wallabag_test;' -U postgres; fi; | |
66 | # increase swap to avoid "proc_open(): fork failed - Cannot allocate memory" | |
67 | # this should be removed when no more PHP 5 build will be defined | |
68 | - sudo swapon -s | |
69 | - sudo fallocate -l 4G /swapfile | |
70 | - sudo chmod 600 /swapfile | |
71 | - sudo mkswap /swapfile | |
72 | - sudo swapon /swapfile | |
73 | - sudo swapon -s | |
74 | ||
75 | script: | |
76 | - travis_wait bash composer install -o --no-interaction --no-progress --prefer-dist | |
77 | - echo "travis_fold:start:prepare" | |
78 | - make prepare DB=$DB | |
79 | - echo "travis_fold:end:prepare" | |
80 | ||
81 | - echo "travis_fold:start:fixtures" | |
82 | - php bin/console doctrine:fixtures:load --no-interaction --env=test | |
83 | - echo "travis_fold:end:fixtures" | |
84 | ||
85 | - if [[ $VALIDATE_TRANSLATION_FILE = '' ]]; then ./bin/simple-phpunit -v ; fi; | |
86 | - if [[ $CS_FIXER = run ]]; then php bin/php-cs-fixer fix --verbose --dry-run ; fi; | |
87 | - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/CoreBundle/Resources/translations -v ; fi; | |
88 | - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml app/Resources/CraueConfigBundle/translations -v ; fi; | |
89 | - if [[ $VALIDATE_TRANSLATION_FILE = run ]]; then php bin/console lint:yaml src/Wallabag/UserBundle/Resources/translations -v ; fi; | |
90 | - if [[ $ASSETS = build ]]; then yarn run build:prod; fi; |