-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from EC-CUBE/improve-40
EC-CUBE4.0対応
- Loading branch information
Showing
37 changed files
with
897 additions
and
2,121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,92 @@ | ||
language: php | ||
|
||
sudo: required | ||
dist: trusty | ||
group: deprecated-2017Q4 | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
- vendor | ||
- $HOME/.composer/cache | ||
- bin/.phpunit | ||
|
||
php: | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- 7.2 | ||
|
||
env: | ||
# plugin code | ||
global: | ||
PLUGIN_CODE=RelatedProduct | ||
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.9 | ||
- ECCUBE_VERSION=3.0.9 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root | ||
- ECCUBE_VERSION=3.0.9 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres | ||
# ec-cube 3.0.16 | ||
- ECCUBE_VERSION=3.0.16 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root | ||
- ECCUBE_VERSION=3.0.16 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres | ||
matrix: | ||
fail_fast: true | ||
fast_finish: true | ||
include: | ||
- php: 5.3 | ||
dist: precise | ||
- php: 7.1 | ||
env: ECCUBE_VERSION=master DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres COVERAGE=true | ||
exclude: | ||
- php: 7.1 | ||
env: ECCUBE_VERSION=master DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres | ||
allow_failures: | ||
- 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=3.0.9 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root | ||
- php: 7.0 | ||
env: ECCUBE_VERSION=3.0.9 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres | ||
- php: 7.1 | ||
env: ECCUBE_VERSION=3.0.9 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root | ||
- php: 7.1 | ||
env: ECCUBE_VERSION=3.0.9 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres | ||
PLUGIN_CODE=RelatedProduct4 | ||
BRANCH=4.0 | ||
|
||
install: | ||
- gem install mime-types -v 2.99.1 | ||
- gem install mailcatcher | ||
before_install: &php_setup | | ||
phpenv config-rm xdebug.ini || true | ||
echo "opcache.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini | ||
|
||
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 global require hirak/prestissimo | ||
- 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 | ||
install_eccube: &install_eccube | | ||
tar cvzf ${HOME}/${PLUGIN_CODE}.tar.gz ./* | ||
git clone https://github.com/EC-CUBE/ec-cube.git | ||
cd ec-cube | ||
git checkout -b ${BRANCH} origin/${BRANCH} | ||
composer selfupdate | ||
composer install --dev --no-interaction -o --apcu-autoloader | ||
|
||
script: | ||
# exec phpunit on ec-cube | ||
- if [ !$COVERAGE ]; then ./vendor/bin/phpunit app/Plugin/${PLUGIN_CODE}/Tests; fi | ||
- if [ $COVERAGE ]; then ./vendor/bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist --coverage-clover=coverage.clover; fi | ||
eccube_setup: &eccube_setup | | ||
echo "APP_ENV=test" > .env | ||
bin/console doctrine:database:create | ||
bin/console doctrine:schema:create | ||
bin/console eccube:fixtures:load | ||
bin/console eccube:plugin:install --path=${HOME}/${PLUGIN_CODE}.tar.gz -vvv | ||
bin/console eccube:plugin:enable --code=${PLUGIN_CODE} -vvv | ||
|
||
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 [ $COVERAGE ]; then php vendor/bin/coveralls -v -x coverage.clover; fi | ||
jobs: | ||
fast_finish: true | ||
include: | ||
- stage: Inspection | ||
php: 7.1 | ||
env: DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9 | ||
install: | ||
- *install_eccube | ||
- *eccube_setup | ||
script: vendor/bin/php-cs-fixer fix --config=.php_cs.dist --dry-run app/Plugin/${PLUGIN_CODE} | ||
- &unit_test | ||
stage: Unit Test | ||
env: DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5 | ||
before_install: | ||
- *php_setup | ||
- gem install mime-types -v 2.99.1 | ||
- gem install mailcatcher | ||
install: | ||
- *install_eccube | ||
- *eccube_setup | ||
# mail catcher | ||
- mailcatcher | ||
script: | ||
- ./bin/phpunit app/Plugin/${PLUGIN_CODE}/Tests | ||
after_script: | ||
# disable plugin | ||
- bin/console eccube:plugin:disable --code=${PLUGIN_CODE} | ||
# uninstall plugin | ||
- bin/console eccube:plugin:uninstall --code=${PLUGIN_CODE} | ||
# re install plugin | ||
- bin/console eccube:plugin:install --code=${PLUGIN_CODE} | ||
# re enable plugin | ||
- bin/console eccube:plugin:enable --code=${PLUGIN_CODE} | ||
- <<: *unit_test | ||
env: DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9 | ||
- &coverage | ||
stage: Code Coverage | ||
env: DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9 COVERAGE=1 | ||
before_install: | ||
- *php_setup | ||
- gem install mime-types -v 2.99.1 | ||
- gem install mailcatcher | ||
install: | ||
- *install_eccube | ||
- *eccube_setup | ||
# mail catcher | ||
- mailcatcher | ||
script: | ||
- ./bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist --coverage-clover=coverage.clover | ||
after_success: | ||
- php vendor/bin/php-coveralls -v -x coverage.clover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.