forked from OXID-eSales/oxideshop_ce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
75 lines (61 loc) · 2.83 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
language: php
dist: xenial
notifications:
email: false
php:
- "7.4"
- "8.0"
matrix:
fast_finish: true
cache:
directories:
- $HOME/.composer/cache/files
# Numeric values of error reporting levels:
# 32767: E_ALL
# 30711: E_ALL & ~E_NOTICE & ~E_STRICT
# 24575: E_ALL & ~E_DEPRECATED
# 24567: E_ALL & ~E_DEPRECATED & ~E_NOTICE
# 22527: E_ALL & ~E_DEPRECATED & ~E_STRICT
# 22519: E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT
#
# Keep TRAVIS_ERROR_LEVEL in sync with the value in vendor/oxid-esales/testing-library/base.php
#
env: TRAVIS_ERROR_LEVEL=32767 OX_BASE_PATH="$TRAVIS_BUILD_DIR/source/"
services: mysql
before_install:
- echo 'Europe/Berlin' | sudo tee /etc/timezone
- sudo dpkg-reconfigure --frontend noninteractive tzdata
- sudo apt-get update
before_script:
# remove xdebug
- phpenv config-rm xdebug.ini
# apache setup (https://docs.travis-ci.com/user/languages/php/#apache--php)
- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
- if [[ $(phpenv version-name) = 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 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
# configure apache virtual hosts
- sudo cp .travis.sites_conf /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)/source?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
# database setup
- sudo sed -e 's|utf8_unicode_ci|latin1_general_ci|g; s|utf8|latin1|g' --in-place /etc/mysql/my.cnf
- sudo service mysql restart
# replace configuration values in config.inc.php
- cp source/config.inc.php.dist source/config.inc.php
- sed -i 's|<dbHost>|localhost|; s|<dbPort>|3306|; s|<dbName>|oxideshop|; s|<dbUser>|root|; s|<dbPwd>||; s|<sShopURL>|http://localhost|; s|<sShopDir>|'$TRAVIS_BUILD_DIR'/source|; s|<sCompileDir>|'$TRAVIS_BUILD_DIR'/source/tmp|; s|$this->iDebug = 0|$this->iDebug = 1|' source/config.inc.php
- sed -i "s|\$this->edition = ''|\$this->edition = 'CE'|" source/config.inc.php
# set permissions to log directory
- chmod -R 777 "${TRAVIS_BUILD_DIR}/source/log"
# composer initiation
- COMPOSER_MEMORY_LIMIT=-1 SHOP_PATH='source' SHOP_TESTS_PATH='tests' MODULES_PATH='' composer install
script:
- php vendor/bin/phpcs
- vendor/bin/psalm -v
- vendor/bin/psalm --show-info=false --threads=4
- php vendor/bin/runtests