From cae1c18432a6306a28590605f5e5a70be8a8c63d Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Sat, 27 Jul 2013 20:15:05 +0200
Subject: [PATCH] [TASK] Run phpLint and phpUnit in different travis builds

phpLint checks php files for compilation errors in travis before
the unit tests are executed. This takes quite some time.
The patch configures travis to run phpLint and phpUnit in different
builds to speed up the process. Additionally, phpLint environment
does not clone phpunit and the introduction package and does no
database initialization.

Change-Id: Ie25ade5b6a8fcf4c4dc0752fc8662c433ea3c33c
Resolves: #50492
Releases: 6.2, 6.1, 6.0
Reviewed-on: https://review.typo3.org/22624
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
---
 .travis.yml | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 2c3658717ea5..bfe8e9d2f9c9 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,7 +5,8 @@ php:
   - 5.5
 
 env:
-  - DB=mysql
+  - DB=mysql PHPUNIT=1
+  - DB=none PHPLINT=1
 
 services:
   - memcached
@@ -20,11 +21,11 @@ before_script:
   - if [[ "$TRAVIS_PHP_VERSION" == "5.3" ]]; then installPhpModule -y apc; fi
 
 # Install rudimentary TYPO3
-  - git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Distributions/Introduction.git build-environment/Introduction
-  - mv build-environment/typo3conf .
-  - git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Extensions/phpunit.git typo3conf/ext/phpunit/
-  - mkdir fileadmin
-  - mkdir uploads
+  - if [[ "$PHPUNIT" == "1" ]]; then git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Distributions/Introduction.git build-environment/Introduction; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then mv build-environment/typo3conf .; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then git clone --single-branch --branch master --depth 1 git://git.typo3.org/TYPO3v4/Extensions/phpunit.git typo3conf/ext/phpunit/; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then mkdir fileadmin; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then mkdir uploads; fi
   - if [[ "$DB" == "mysql" ]]; then mysql -e "DROP DATABASE IF EXISTS typo3_test;" -uroot; fi
   - if [[ "$DB" == "mysql" ]]; then mysql -e "create database IF NOT EXISTS typo3_test;" -uroot; fi
   - if [[ "$DB" == "mysql" ]]; then mysql -uroot typo3_test < build-environment/Introduction/typo3conf/ext/introduction/Resources/Private/Subpackages/Introduction/Database/introduction.sql; fi
@@ -33,5 +34,5 @@ before_script:
   - if [[ "$DB" == "mysql" ]]; then mysql -uroot typo3_test < build-environment/dbimport/phpunit.sql; fi
 
 script:
-  - phpLint all
-  - php $PWD/typo3/cli_dispatch.phpsh phpunit -c typo3/sysext/core/Build/UnitTests.xml
+  - if [[ "$PHPLINT" == "1" ]]; then phpLint all; fi
+  - if [[ "$PHPUNIT" == "1" ]]; then php $PWD/typo3/cli_dispatch.phpsh phpunit -c typo3/sysext/core/Build/UnitTests.xml; fi
-- 
GitLab