[TASK] Smarter functional test parallelization
[Packages/TYPO3.CMS.git] / .travis.yml
1 language: php
2
3 node_js:
4     - "0.10"
5
6 matrix:
7   fast_finish: true
8
9   include:
10     - php: 7
11       env: UNIT_TESTS=yes FUNCTIONAL_TESTS=yes ACCEPTANCE_TESTS=no JSUNIT_TESTS=yes PHP_LINT=yes XLF_CHECK=yes SUBMODULE_TEST=yes  EXCEPTIONCODE_TEST=yes
12
13 sudo: false
14
15 addons:
16   apt:
17     packages:
18       - parallel
19       - ack-grep
20       - nginx
21       - realpath
22
23 cache:
24   directories:
25     - $HOME/.composer/cache
26
27 env:
28   global:
29     secure: NGVAI0ayw2h9pB2bi2u9AkfV1OKa2LCrGXNtxAvQhFxKW28qmeOUehFuacxpvCI5fA8Ae7oVo2Ba0vcpb5a3uJry1lMpxcn9Ic+voB7SwlCuL6Rx/vntPkYUH+58cC3t40yHKArCUE9KCJA6znNCaZ7MyG6dWHgry0cvAjVOQzE=
30
31 services:
32   - memcached
33   - redis-server
34
35 notifications:
36   irc:
37     channels:
38       - "irc.freenode.net#typo3-cms"
39     on_success: change
40     on_failure: always
41     use_notice: true
42   slack:
43     rooms:
44       secure: nHWVTPyG3CQWIcYA1LASS11dD0/NBcmrAyr3xxQW0XYtH47ZUKRlEtxrVLuL7ptciNwMbfZgsiRQ1QGWDerHUlBkg0iwRxpUZgeylzWaiXsHFVAp2IBfEX54KrWeYm9gewIBDDtnp+sLgpXGgmpIs2bAGkZe5129UsUExoWh0+g=
45     on_success: change
46     on_failure: always
47   webhooks:
48     urls:
49       - http://www.t3bot.de/hooks/travis/index.php
50     on_success: always
51     on_failure: always
52     on_start: never
53
54 before_script:
55   - phpenv config-rm xdebug.ini
56   - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
57   - echo "extension = redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
58   - if [ "$GITHUB_COMPOSER_AUTH" ]; then composer config -g github-oauth.github.com $GITHUB_COMPOSER_AUTH; fi
59   - composer install
60   - typo3/sysext/core/Build/Configuration/TravisNginxFpm/ConfigureStartNginxFpm.sh
61   - mkdir -p typo3temp/var/tests
62   - export typo3DatabaseName="typo3"
63   - export typo3DatabaseHost="localhost"
64   - export typo3DatabaseUsername="root"
65   - export typo3DatabasePassword=""
66
67 before_install:
68     - export DISPLAY=:99.0
69     - sh -e /etc/init.d/xvfb start
70
71 script:
72   - >
73     if [[ "$UNIT_TESTS" == "yes" ]]; then
74       ./bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml
75     fi
76
77   - >
78     if [[ "$FUNCTIONAL_TESTS" == "yes" ]]; then
79       ./typo3/sysext/core/Build/Scripts/splitFunctionalTests.sh 6
80       parallel -a <(seq 0 5) --gnu './bin/phpunit -c typo3/sysext/core/Build/FunctionalTests-Job-{}.xml'
81     fi
82
83   - >
84     if [[ "$ACCEPTANCE_TESTS" == "yes" ]]; then
85       ./bin/codecept run Acceptance -c typo3/sysext/core/Build/AcceptanceTests.yml --debug
86     fi
87
88   - >
89     if [[ "$JSUNIT_TESTS" == "yes" ]]; then
90       cd Build && npm install && cd ..
91       ./Build/node_modules/karma/bin/karma start typo3/sysext/core/Build/Configuration/JSUnit/karma.conf.js --single-run
92     fi
93
94   - >
95     if [[ "$PHP_LINT" == "yes" ]]; then
96       find typo3/ -name \*.php -not -path "vendor/*" | parallel --jobs 6 --gnu php -d display_errors=stderr -l {} > /dev/null \;
97     fi
98
99   - >
100     if [[ "$XLF_CHECK" == "yes" ]]; then
101       ./typo3/sysext/core/Build/Scripts/xlfcheck.sh
102     fi
103
104   - >
105     if [[ "$SUBMODULE_TEST" == "yes" ]]; then
106       /bin/bash -c "
107         if [[ `git submodule status 2>&1 | wc -l` -ne 0 ]]; then
108           echo \"Found a submodule definition in repository\";
109           exit 99;
110         fi
111       "
112     fi
113
114   - >
115     if [[ "$EXCEPTIONCODE_TEST" == "yes" ]]; then
116       ./typo3/sysext/core/Build/Scripts/duplicateExceptionCodeCheck.sh
117     fi