[TASK] Execute functional tests and lint in parallel
[Packages/TYPO3.CMS.git] / .travis.yml
1 language: php
2
3 php:
4   - 5.3
5   - 5.4
6   - 5.5
7
8 env:
9   - DB=mysql UNITTESTS=1
10   - DB=none FUNCTIONALTESTS=1
11   - DB=none PHPLINT=1
12
13 notifications:
14   irc:
15     - "irc.freenode.net#typo3-cms"
16   email:
17     - typo3-team-core@lists.typo3.org
18
19 services:
20   - memcached
21
22 before_script:
23   - sudo apt-get install parallel
24   - sudo apt-get update && sudo apt-get install git
25   - git clone --single-branch --branch master --depth 1 git://github.com/typo3-ci/TYPO3-Travis-Integration.git build-environment
26   - source build-environment/install-helper.sh
27
28   - >
29     if [[ "$UNITTESTS" == "1" ]]; then
30         if [[ "$TRAVIS_PHP_VERSION" == "5.3" ]]; then
31                 installPhpModule -y apc;
32         fi
33         if [[ "$TRAVIS_PHP_VERSION" != "5.5" ]]; then
34                 installPhpModule igbinary
35         fi
36         installPhpModule -y memcache
37         installPhpModule redis
38         mv build-environment/typo3conf .
39         git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3CMS/Extensions/phpunit.git typo3conf/ext/phpunit/
40         mkdir fileadmin
41         mkdir uploads
42         mkdir typo3temp
43     fi
44
45   - >
46     if [[ "$FUNCTIONALTESTS" == "1" ]]; then
47         mv build-environment/typo3conf .
48         git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3CMS/Extensions/phpunit.git typo3conf/ext/phpunit/
49         mkdir typo3temp
50     fi
51
52   - >
53     if [[ "$DB" == "mysql" ]]; then
54         mysql -e "DROP DATABASE IF EXISTS typo3_test;" -uroot
55         mysql -e "CREATE DATABASE IF NOT EXISTS typo3_test;" -uroot
56         php build-environment/dbimport/DatabaseImport.php
57         mysql -uroot typo3_test < build-environment/dbimport/cli_users.sql
58     fi
59
60 script:
61   - >
62     if [[ "$PHPLINT" == "1" ]]; then
63         phpLint all
64     elif [[ "$UNITTESTS" == "1" ]]; then
65         ./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml
66     elif [[ "$FUNCTIONALTESTS" == "1" ]]; then
67         grep directory typo3/sysext/core/Build/FunctionalTests.xml | sed 's#[   ]*<directory>\.\./\.\./\.\./\.\./\(typo3/sysext.*\)</directory>$#\1#g' | parallel --gnu --keep-order 'echo "Running {} tests"; ./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit -c typo3/sysext/core/Build/FunctionalTests.xml {}'
68     else
69         exit 1
70     fi