forked from LimeSurvey/LimeSurvey
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
73 lines (66 loc) · 3.19 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# Note: If you ever need to debug Travis locally, see this
# documentation: https://docs.travis-ci.com/user/common-build-problems/#Running-a-Container-Based-Docker-Image-Locally
#
language: php
php:
- 7.0
- 7.1
- 5.6
before_script:
# Test
#- sudo apt-get update
#- sudo apt-get upgrade
# disable xdebug to speed up tests
- phpenv config-rm xdebug.ini
# Install LimeSurvey.
- phpunit --version
- mysql --version
- touch enabletests
#- rm composer.lock
#- rm -r third_party
- composer install
- chmod -R 777 tmp
- chmod -R 777 upload
- chmod -R 777 themes # Need 777 so both console and web server can cd into the folder.
- chmod -R 777 tests/tmp
- php application/commands/console.php install admin password TravisLS no@email.com verbose
- cp application/config/config-sample-mysql.php application/config/config.php
# Enable debug=2 in config file. OBS: This assumes debug is on line 59.
- sed -i '59s/.*/ "debug"=>2,/' application/config/config.php
# Install Apache.
# Code fetched from https://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
- sudo apt-get update > /dev/null
- sudo apt-get -y --force-yes install apache2 libapache2-mod-fastcgi nodejs firefox
- sudo cp /usr/bin/firefox /usr/local/bin/firefox
- sudo cp /usr/bin/firefox /usr/local/bin/firefox-bin
- which firefox
- firefox -v
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.6" ]]; then sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf; fi
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- sudo cp -f tests/travis/travis-ci-apache /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
# Test server.
- wget localhost
- more localhost
# Chromedriver setup.
# Note: Keep getting timeout problems on Travis with chromedriver.
#- wget https://chromedriver.storage.googleapis.com/2.33/chromedriver_linux64.zip
#- unzip chromedriver_linux64.zip
# Setup Selenium with Firefox headless mode.
- wget "https://selenium-release.storage.googleapis.com/3.7/selenium-server-standalone-3.7.1.jar"
- wget "https://github.com/mozilla/geckodriver/releases/download/v0.19.1/geckodriver-v0.19.1-linux64.tar.gz"
- tar xvzf geckodriver-v0.19.1-linux64.tar.gz
- export MOZ_HEADLESS=1
- java -jar selenium-server-standalone-3.7.1.jar -enablePassThrough false > /dev/null 2> /dev/null &
script:
# Check for syntax errors.
- find application/ -type f -name "*.php" -exec php -l {} \; | grep -v 'No syntax errors' || true
# Run tests.
- DOMAIN=localhost phpunit