[TASK] Fix travis builds
[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 services:
14   - memcached
15
16 before_script:
17   - sudo apt-get update && sudo apt-get install git
18   - git clone --single-branch --branch master --depth 1 git://github.com/typo3-ci/TYPO3-Travis-Integration.git build-environment
19   - source build-environment/install-helper.sh
20
21   - >
22     if [[ "$UNITTESTS" == "1" ]]; then
23         if [[ "$TRAVIS_PHP_VERSION" == "5.3" ]]; then
24                 installPhpModule -y apc;
25         fi
26         if [[ "$TRAVIS_PHP_VERSION" != "5.5" ]]; then
27                 installPhpModule igbinary
28         fi
29         installPhpModule -y memcache
30         installPhpModule redis
31         mv build-environment/typo3conf .
32         git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Extensions/phpunit.git typo3conf/ext/phpunit/
33         mkdir fileadmin
34         mkdir uploads
35         mkdir typo3temp
36     fi
37
38   - >
39     if [[ "$FUNCTIONALTESTS" == "1" ]]; then
40         mv build-environment/typo3conf .
41         git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Extensions/phpunit.git typo3conf/ext/phpunit/
42         mkdir typo3temp
43     fi
44
45   - >
46     if [[ "$DB" == "mysql" ]]; then
47         mysql -e "DROP DATABASE IF EXISTS typo3_test;" -uroot
48         mysql -e "CREATE DATABASE IF NOT EXISTS typo3_test;" -uroot
49         php build-environment/dbimport/DatabaseImport.php
50         mysql -uroot typo3_test < build-environment/dbimport/cli_users.sql
51     fi
52
53 script:
54   - >
55     if [[ "$PHPLINT" == "1" ]]; then
56         phpLint all
57     elif [[ "$UNITTESTS" == "1" ]]; then
58         ./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit -c typo3/sysext/core/Build/UnitTests.xml
59     elif [[ "$FUNCTIONALTESTS" == "1" ]]; then
60         ./typo3conf/ext/phpunit/Composer/vendor/bin/phpunit -c typo3/sysext/core/Build/FunctionalTests.xml
61     else
62         exit 1
63     fi