Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
93 lines (82 sloc) 2.86 KB
language: php
sudo: required
cache:
directories:
- $HOME/.composer/cache
php:
- 5.4
- 5.5
- 5.6
- 7.0
env:
# plugin code
global:
PLUGIN_CODE=Coupon
matrix:
# ec-cube master
- ECCUBE_VERSION=master DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=master DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- ECCUBE_VERSION=master DB=sqlite
# ec-cube 3.0.13
- ECCUBE_VERSION=3.0.13 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=3.0.13 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
# ec-cube 3.0.15
- ECCUBE_VERSION=3.0.15 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=3.0.15 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
matrix:
fast_finish: true
include:
- php: 5.3
dist: precise
exclude:
allow_failures:
- php: 5.3
env: ECCUBE_VERSION=master DB=sqlite
- php: 5.4
env: ECCUBE_VERSION=master DB=sqlite
- php: 5.5
env: ECCUBE_VERSION=master DB=sqlite
- php: 5.6
env: ECCUBE_VERSION=master DB=sqlite
- php: 7.0
env: ECCUBE_VERSION=master DB=sqlite
install:
- gem install mime-types -v 2.99.1
- gem install mailcatcher
before_script:
# archive plugin
- tar cvzf ${HOME}/${PLUGIN_CODE}.tar.gz ./*
# clone ec-cube
- git clone https://github.com/EC-CUBE/ec-cube.git
- cd ec-cube
# checkout version
- sh -c "if [ ! '${ECCUBE_VERSION}' = 'master' ]; then git checkout -b ${ECCUBE_VERSION} refs/tags/${ECCUBE_VERSION}; fi"
# update composer
- composer selfupdate
- composer install --dev --no-interaction -o
# install ec-cube
- sh -c "if [ '$DB' = 'mysql' ]; then sh ./eccube_install.sh mysql none; fi"
- sh -c "if [ '$DB' = 'pgsql' ]; then sh ./eccube_install.sh pgsql none; fi"
- sh -c "if [ '$DB' = 'sqlite' ]; then sh ./eccube_install.sh sqlite3 none; fi"
# install plugin
- php app/console plugin:develop install --path=${HOME}/${PLUGIN_CODE}.tar.gz
# enable plugin
- php app/console plugin:develop enable --code=${PLUGIN_CODE}
# mail catcher
- mailcatcher
script:
# exec phpunit on ec-cube
- phpunit app/Plugin/${PLUGIN_CODE}/Tests
- if [[ $TRAVIS_PHP_VERSION =~ ^[7] ]]; then ./vendor/bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist --coverage-clover=coverage.clover ; fi
after_script:
# disable plugin
- php app/console plugin:develop disable --code=${PLUGIN_CODE}
# uninstall plugin
- php app/console plugin:develop uninstall --code=${PLUGIN_CODE}
# re install plugin
- php app/console plugin:develop install --code=${PLUGIN_CODE}
# re enable plugin
- php app/console plugin:develop enable --code=${PLUGIN_CODE}
after_success:
# for coveralls
- if [[ $TRAVIS_PHP_VERSION =~ ^[7] ]]; then php vendor/bin/coveralls -v -x coverage.clover ; fi