Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.travis.yml を追加 #13

Merged
merged 5 commits into from
Jul 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
language: php

dist: xenial

services:
- mysql
- postgresql

cache:
directories:
- vendor
- $HOME/.composer/cache
- bin/.phpunit

php:
- 7.2
- 7.3
- 7.4

env:
global:
PLUGIN_CODE=Api
matrix:
- DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9

before_install: &php_setup |
echo "opcache.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
echo "apc.enabled=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
echo "date.timezone=Asia/Tokyo" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
phpenv config-rm xdebug.ini || true

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 fetch origin pull/4614/head:experimental/plugin_bundle
git checkout experimental/plugin_bundle
composer selfupdate
composer require trikoder/oauth2-bundle:"^2.1" nyholm/psr7:"^1.2" webonyx/graphql-php:"^14.0" -n
composer install --dev --no-interaction -o --apcu-autoloader

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
bin/console eccube:plugin:enable --code=${PLUGIN_CODE}

install:
- *install_eccube
- *eccube_setup

script:
- ./vendor/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}
#
#jobs:
# fast_finish: true
# include:
# - &coverage
# stage: Code Coverage
# php: 7.3
# env: DATABASE_URL=sqlite:///var/eccube.db DATABASE_SERVER_VERSION=3 COVERAGE=1
# before_install:
# - docker pull nanasess/phpdbg
# - docker pull schickling/mailcatcher
# - docker run -d -p 1080:1080 -p 1025:1025 --name mailcatcher schickling/mailcatcher
# install:
# - *install_eccube
# - *php_setup
# - *eccube_setup
# script:
# - docker run -e DATABASE_URL=sqlite:///var/eccube.db -v "$PWD":/usr/src/myapp:cached -w /usr/src/myapp --rm nanasess/phpdbg phpdbg -qrr -dmemory_limit=-1 ./bin/phpunit -c app/Plugin/${PLUGIN_CODE}/phpunit.xml.dist --coverage-clover=app/Plugin/${PLUGIN_CODE}/coverage.clover app/Plugin/${PLUGIN_CODE}/Tests
# after_success:
# - sed -i.bak -e 's|/usr/src/myapp/||g' app/Plugin/${PLUGIN_CODE}/coverage.clover
# - php vendor/bin/php-coveralls -v -x app/Plugin/${PLUGIN_CODE}/coverage.clover