forked from EC-CUBE/mail-magazine-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
113 lines (101 loc) · 4.27 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
language: php
dist: xenial
services:
- mysql
- postgresql
cache:
directories:
- vendor
- $HOME/.composer/cache
- bin/.phpunit
php:
- 7.1
- 7.2
- 7.3
env:
global:
PLUGIN_CODE=MailMagazine4
matrix:
- ECCUBE_VERSION=4.0 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- ECCUBE_VERSION=4.0 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
- ECCUBE_VERSION=4.0.0 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- ECCUBE_VERSION=4.0.0 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
- ECCUBE_VERSION=4.0.1 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- ECCUBE_VERSION=4.0.1 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
- ECCUBE_VERSION=4.0.2 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- ECCUBE_VERSION=4.0.2 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
matrix:
exclude:
- php: 7.3
env: ECCUBE_VERSION=4.0.0 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- php: 7.3
env: ECCUBE_VERSION=4.0.0 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
- php: 7.3
env: ECCUBE_VERSION=4.0.1 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- php: 7.3
env: ECCUBE_VERSION=4.0.1 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
- php: 7.3
env: ECCUBE_VERSION=4.0.2 DATABASE_URL=mysql://root:@localhost/cube4_dev DATABASE_SERVER_VERSION=5
- php: 7.3
env: ECCUBE_VERSION=4.0.2 DATABASE_URL=postgres://postgres:password@localhost/cube4_dev DATABASE_SERVER_VERSION=9
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
install_eccube: &install_eccube |
tar cvzf ${HOME}/${PLUGIN_CODE}.tar.gz ./*
git clone https://github.com/EC-CUBE/ec-cube.git
cd ec-cube
sh -c "if [ '${ECCUBE_VERSION}' = '4.0' ]; then git checkout origin/${ECCUBE_VERSION}; fi"
sh -c "if [ ! '${ECCUBE_VERSION}' = '4.0' ]; then git checkout refs/tags/${ECCUBE_VERSION}; fi"
composer selfupdate
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:
- stage: Inspection
php: 7.2
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 --verbose app/Plugin/${PLUGIN_CODE}
- &coverage
stage: Code Coverage
php: 7.2
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:
- phpdbg -qrr ./vendor/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