-
Notifications
You must be signed in to change notification settings - Fork 16
/
.travis.yml
66 lines (63 loc) · 2.48 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
sudo: required
dist: trusty # Use notancient unbuntu
language: php
php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- 'nightly' # why not
matrix:
allow_failures:
- php: 'nightly'
cache:
directories:
- src/vendor
- $HOME/.cache/composer/files
- node_modules/
addons:
postgresql: '9.5'
services:
- postgresql
before_install:
- nvm install --lts # Updated Node required for eslint
install:
- composer install
- npm install eslint
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-fastcgi
before_script:
# missing read perms on $HOME, which apache24 requires
- chmod 755 $HOME
# enable php-fpm
- phpenv config-add sample_configs/travis-php.ini
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf{.default,}
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf{.default,}
- sudo a2enmod rewrite actions fastcgi alias
- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f sample_configs/travis-fpm.conf /etc/apache2/sites-available/myradio-travis.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/myradio-travis.conf
- sudo a2dissite 000-default
- sudo a2ensite myradio-travis
- sudo service apache2 restart
- sudo apachectl -S
- sudo cat /etc/apache2/sites-enabled/*
# setup postgres
- psql -U postgres < sample_configs/postgres.sql
- PGPASSWORD=myradio psql -U myradio myradio < schema/base.sql
- for f in schema/patches/*.sql; do PGPASSWORD=myradio psql -U myradio myradio < $f; done
- PGPASSWORD=myradio psql -U myradio myradio < sample_configs/travis-auth.sql
# configure MyRadio
- cp sample_configs/travis-config.php src/MyRadio_Config.local.php
script:
- src/vendor/bin/phpcs --standard=PSR2 --ignore="*.min.*,*/vendor/*,*/PublicAPI/rtfm/*,*/Public/js/*" --exclude=Squiz.Classes.ValidClassName,PSR1.Files.SideEffects src/ -p -s
- node_modules/.bin/eslint .
- curl -v http://localhost/api/v2/config/publicconfig?api_key=travis-test-key
- src/vendor/bin/codecept run --debug --env travis
after_script:
- sudo cat $(pwd)/apache-access.log
- sudo cat $(pwd)/apache-error.log
- sudo cat ~/.phpenv/versions/$(phpenv version-name)/var/log/php-fpm.log
- sudo ls -l ~/.phpenv/versions/$(phpenv version-name)/var/log/