forked from EC-CUBE/eccube-api4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
98 lines (86 loc) · 3.63 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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
ECCUBE_PACKAGE_API_URL=http://127.0.0.1:8080
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 checkout experimental/plugin_bundle
composer selfupdate
composer install --dev --no-interaction -o --apcu-autoloader
package_api_setup: &package_api_setup |
mkdir -p /tmp/repos
cp ${HOME}/${PLUGIN_CODE}.tar.gz /tmp/repos/${PLUGIN_CODE}.tgz
docker run --name package-api -d -v /tmp/repos:/repos -e MOCK_REPO_DIR=/repos -p 8080:8080 eccube/mock-package-api
sleep 3
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 doctrine:query:sql "update dtb_base_info set authentication_key='dummy'"
bin/console eccube:composer:require $(jq -r ".name" < ${TRAVIS_BUILD_DIR}/composer.json)
bin/console eccube:plugin:enable --code=${PLUGIN_CODE}
bin/console doctrine:schema:update --force --dump-sql
bin/console trikoder:oauth2:create-client --redirect-uri=http://127.0.0.1:8000/ --grant-type=authorization_code --grant-type=client_credentials --grant-type=implicit --grant-type=password --grant-type=refresh_token --scope=read --scope=write
install:
- *install_eccube
- *package_api_setup
- *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