forked from OpenConext/OpenConext-engineblock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
93 lines (81 loc) · 3.55 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
language: php
dist: xenial
php:
- 5.6
- 7.2
matrix:
fast_finish: true
allow_failures:
- php: 7.2
- env: COMMAND="functional-tests-wip"
sudo: true # sudo is required for behat
env:
matrix:
- COMMAND="functional-tests"
- COMMAND="functional-tests-wip"
- COMMAND="functional-tests-selenium"
- COMMAND="code-quality-ci"
- COMMAND="security-tests"
- COMMAND="validate"
global:
- SYMFONY_ENV=test
- ENGINEBLOCK_ENV=test
- ANT_OPTS=-Xmx256m # ensure we got enough memory for ant
cache:
directories:
- ~/.composer/cache/files
- "$HOME/.npm"
before_install:
- mysql -e "create database IF NOT EXISTS eb_test;" -uroot
- mysql -uroot -e "CREATE USER 'eb_testrw'@'localhost' IDENTIFIED BY 'secret';"
- mysql -uroot -e "GRANT ALL ON eb_test.* TO 'eb_testrw'@'localhost';"
before_script:
- phpenv config-add .travis.php.ini
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then printf "\n" | pecl uninstall apcu; fi
- if [[ ${TRAVIS_PHP_VERSION:0:3} == "5.6" ]]; then printf "\n" | pecl install apcu-4.0.10; fi
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then sed -i 's,apc,array,' ~/build/OpenConext/OpenConext-engineblock/app/config/config.yml; fi
- sudo ln -s "$(pwd)"/ci/travis/files/ /etc/openconext
- mkdir -p /tmp/engineblock/cache/test
- mkdir -p /tmp/engineblock/logs/test
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi ant
- if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; 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 cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- sudo a2enmod rewrite actions fastcgi alias ssl
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
- sudo cp -f ci/travis/vhost-apache /etc/apache2/sites-available/default-ssl.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default-ssl.conf
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- sudo a2dissite 000-default
- sudo a2ensite default-ssl
- sudo service apache2 restart
- sudo mkdir -p /opt/selenium && wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.1.jar && sudo mv selenium-server-standalone-2.53.1.jar /opt/selenium/
- wget https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && rm chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /opt/selenium/chromedriver
- sudo /usr/bin/java -jar /opt/selenium/selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver=/opt/selenium/chromedriver -host 127.0.0.1 -port 4444 &
- composer self-update
- composer config secure-http false
- composer install --prefer-dist -n -o
- app/console cache:clear --env=test
- npm ci --prefix=theme
- cd theme && npm run build && cd ..
script:
- ant $COMMAND
branches:
only:
- 5.x-dev
- master
- release/5.8
- feature/error-page-styling
after_failure:
- sudo tail -500 /var/log/apache2/error.log
- sudo tail -500 /var/log/apache2/access.log
- cat ~/build/OpenConext/OpenConext-engineblock/app/logs/test/test.log
- sudo tail -500 /var/log/syslog
- sudo tail -500 /tmp/selenium-log
addons:
hosts:
- engine.vm.openconext.org
mariadb: '10.2'
chrome: stable