forked from LimeSurvey/LimeSurvey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
118 lines (104 loc) · 5.58 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# 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
# dummy
language: php
services:
- mysql
php:
- 7.2
- 7.3
- 7.4
env:
- DBENGINE=MYISAM
- DBENGINE=INNODB
services:
- mysql
notifications:
email:
recipients:
- secure: "1x0CmJbr8GWdS7OJ5PRchf0lDxNk4quRfbZ4Slu4GnEMh599Bo1jhsRZnc5ghOf9Yuwn4FzB4Oyfr6tIXP63FbUE2F4lhCwluxw7BWRmjvwMncctWqgDu7Jn3HRXlTdoVNhPlspBsbsNw7waeER6+jv6YFyMKH6gYXtUqloCuyrrhkLWetpj5qvGXmEV22Rhh0kLl9q/Khu0hI8eS022wLs1hQFurc4xbCvpSpcSzmxaD6gevKCuRiLJbG3QsT7lTAwm6U1QqSEMQP5QKhvQ01klttVD3KG2/F6Gs5pKhiNSKYmzeI5OqU7BggQQKCTBi1G0FNsqtFi+InwBoY09RrHpbGDzCOfeRqr/DQAiZKxt2p4d7OEwPcbojvHSG4gG3hIfScCyJGNVa9hZAfR7qyg1wcQdAUfZB+DFNE9FaYdXHFsjKtq/iHROqnS6FNFJF2hRR8diltDTdra5A81LuZcsA82WAj1PPT07kzzKfcbSHHfHaT2H8bzZ3LLd7rjUqW1hd5pK/TfhtPOLCiSLmcktbppcM5V64e9ZoPmywVsFD3GJ+kxBqQ6hx40JcyKkFmiU6WGoYurt/OhXMvRtkWVbeF52M7Mzpx9Iyh48mf3Xm55Q5GnYv0gKKgwYAllPOFXuNCk+DVcs4inpTvwQsCt/7W2RGwMIxlDhJ0+QySk="
on_success: change
on_failure: always
before_script:
# Before running composer install, check that the autoloader is up-to-date and all classes can be loaded.
- php tests/check_autoloader.php
# Test
#- sudo apt-get update
#- sudo apt-get upgrade
- echo $archive_url
- php -r 'var_dump(PHP_INT_SIZE);'
# disable xdebug to speed up tests
- phpenv config-rm xdebug.ini
# Install LimeSurvey.
- php -m # Spit out all loaded PHP modules
- mysql --version
- sudo service mysql status
- touch enabletests
# NB: PHPUnit 6.5.* is installed with composer.
- composer install
- ./third_party/bin/phpunit --version
- 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
# InnoDb needs large_file_prefix & Barracuda file format
# https://discuss.gogs.io/t/solved-mysql-error-1064-while-running-first-install/1604
- sudo service mysql status
- mysql -uroot -e "Show variables like '%large%';"
- mysql -uroot -e "SET @@global.innodb_large_prefix = 1;"
- mysql -uroot -e "SET @@global.innodb_file_format = Barracuda;"
- mysql -uroot -e "SET @@global.innodb_file_format_max = Barracuda;"
- mysql -uroot -e "Show variables like '%large%';"
- mysql -uroot -e "Show variables like '%innodb_file%';"
- mysql -uroot -e "Show variables like '%innodb_default%';"
- php application/commands/console.php install admin password TravisLS [email protected] 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 61.
# TODO: Disable, a lines was added to config file and some tests started to fail.
# - sed -i '61s/.*/ "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
# Check for syntax errors.
# TODO: Should be ! find ... instead of || true (when all warnings are fixed)
- find application/ -type f -name "*.php" -exec php -l {} \; | grep -v 'No syntax errors' || true
# Test server.
- wget localhost
- cat index.html
# 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.27.0/geckodriver-v0.27.0-linux64.tar.gz"
- tar xvzf geckodriver-v0.27.0-linux64.tar.gz
- export MOZ_HEADLESS=1
- java -jar selenium-server-standalone-3.7.1.jar -enablePassThrough false > /dev/null 2> /dev/null &
# Prepare the packages that need to be tested
- nvm install 10.16.3
- nvm use 10.16.3
- node ./buildVueComponents.js -s adminbasics,filemanager -p
- node ./buildVueComponents.js -s adminbasics,filemanager,questioneditor -p
script:
# Run tests.
- DOMAIN=localhost ./third_party/bin/phpunit --stop-on-failure
- yarn --cwd ./assets/packages/filemanager run test
- yarn --cwd ./assets/packages/adminbasics run test
- yarn --cwd ./assets/packages/questioneditor run test