-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
87 lines (74 loc) · 3.24 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
language: php
php:
- 5.3
python:
- 3.3
addons:
postgresql: "9.1"
git:
# We have to init submodules ourselves to make it recursive
submodules: false
before_install:
# Start submodules
- ./tools/startSubmodulesTRAVIS.sh
# Start apache and configure a virtual host.
- sudo apt-get update > /dev/null
- sudo apt-get install -y --force-yes apache2 libapache2-mod-php5 php5-curl php5-mysql php5-intl
- sudo sed -i -e "s,/var/www,$(pwd)/,g" /etc/apache2/sites-available/default
- sudo sed -i -e "s,\${APACHE_LOG_DIR},$(pwd),g" /etc/apache2/sites-available/default
- sudo /etc/init.d/apache2 restart
# Install phpunit in a phar package with selenium extension already on it.
- sudo rm -R /home/travis/.phpenv/versions/5.3/bin/phpunit
- wget --no-check-certificate https://phar.phpunit.de/phpunit.phar
- chmod +x phpunit.phar
- sudo mv phpunit.phar /home/travis/.phpenv/versions/5.3/bin/phpunit
# Xvfb requirements.
- sudo apt-get install -y x11-xkb-utils
# Add fonts.
- sudo apt-get install -y xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
- sudo apt-get install -y defoma x-ttcidfont-conf cabextract ttf-mscorefonts-installer
- sudo dpkg-reconfigure --default-priority x-ttcidfont-conf
- mkfontdir
# Start Virtual Framebuffer to imitate a monitor.
- sudo Xvfb :10 -ac > xvfb-output &
- export DISPLAY=:10
- sleep 3 # Give xvfb time to start.
# Start selenium server.
- wget http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar
- nohup java -jar selenium-server-standalone-2.41.0.jar -browserSessionReuse > selenium-output &
- sleep 3 # Give selenium server time to start.
# Install the test MySQL database.
- mysql -u root -e 'CREATE DATABASE `ojs-ci` DEFAULT CHARACTER SET utf8'
- mysql -u root ojs-ci < tests/functional/testserver.sql
- mysql -u root -e "GRANT ALL ON \`ojs-ci\`.* TO \`ojs-ci\`@localhost IDENTIFIED BY 'ojs-ci'"
# Install the test PostgreSQL database, using data converted from MySQL
- psql -c 'CREATE DATABASE "ojs-ci";' -U postgres
# Files dependency.
- mv config.TRAVIS.inc.php config.inc.php
- mkdir screenshots
# Make sure permissions are ok.
- sudo chown -R travis:www-data .
# Install python, linter, closure compiler stuff
- sudo easy_install "http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz"
- wget -O compiler.zip "https://closure-compiler.googlecode.com/files/compiler-20120917.zip"
- unzip compiler.zip compiler.jar
- mkdir ~/bin
- mv compiler.jar ~/bin
- wget "http://jslint4java.googlecode.com/files/jslint4java-2.0.2-dist.zip"
- unzip jslint4java-2.0.2-dist.zip
- mv jslint4java-2.0.2/jslint4java-2.0.2.jar ~/bin/jslint4java.jar
# Sleep and output our logs, to avoid hanging
# build with no access to logs.
- (sleep 590; cat access.log; cat error.log; cat xvfb-output; cat selenium-output cat ./lib/pkp/tests/results/error.log) &
script:
- ./lib/pkp/tools/runAllTests.sh -Ccf
- ./lib/pkp/tools/validatexml.sh
- ./lib/pkp/tools/buildjs.sh
after_script:
# Print logs and outputs for debugging.
- cat access.log
- cat error.log
- cat xvfb-output
- cat selenium-output
- cat ./lib/pkp/tests/results/error.log
- for f in lib/pkp/tests/results/*.png; do cat $f | base64; done