-
Notifications
You must be signed in to change notification settings - Fork 30
/
.travis.yml
37 lines (34 loc) · 1.39 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
# Configuration file for running the test suite. Results will be at https://travis-ci.com/phpList/phplist-plugin-restapi
# whitelist
language: php
php:
- 7.4
- 7.3
- 7.2
- 7.1
- 7.0
- 5.6
before_script:
- sudo apt-get update > /dev/null
- sudo apt-get install -y --force-yes apache2 libapache2-mod-php php-curl php-mysql php-intl
# Set a custom vhost
- sudo sed -i -e "s,/var/www,$(pwd)/vendor/phpList/phplist3/public_html,g" /etc/apache2/sites-available/default
- sudo sed -i -e "/DocumentRoot/i\ServerName phplist.dev" /etc/apache2/sites-available/default
- sudo sed -i -e "/DocumentRoot/i\SetEnv ConfigFile $(pwd)/tests/travis-ci/config.php" /etc/apache2/sites-available/default
- echo "127.0.0.1 phplist.dev" | sudo tee -a /etc/hosts
- sudo cat /etc/apache2/sites-available/default
- sudo /etc/init.d/apache2 restart
- composer self-update
- composer install --prefer-dist
- sudo cp -f tests/travis-ci/behat.yml behat.yml
- sudo cp -f tests/travis-ci/phpunit.xml tests/phpunit/
# Set MySQL configuration and create the database.
- mysql -e 'SET GLOBAL wait_timeout = 5400;'
- mysql -e 'create database phplisttraviscidb;'
script:
- vendor/bin/behat
- phpunit -c tests/phpunit/phpunit.xml tests/phpunit/restapi.php
after_failure:
- echo "Failures detected. Outputing additional logs:"
- sudo cat /var/log/apache2/error.log
- sudo cat /var/log/mysql/error.log