-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.travis.yml
108 lines (99 loc) · 4.22 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
language: php
sudo: required
cache:
directories:
- $HOME/.composer/cache
php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
env:
# plugin code
global:
PLUGIN_CODE=MailTemplateEditor
matrix:
# ec-cube 3.1
- ECCUBE_VERSION=3.1 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=3.1 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- ECCUBE_VERSION=3.1 DB=sqlite
# ec-cube 3.0.17
- ECCUBE_VERSION=3.0.17 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=3.0.17 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- ECCUBE_VERSION=3.0.17 DB=sqlite
# ec-cube 3.0.18
- ECCUBE_VERSION=3.0.18 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=3.0.18 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- ECCUBE_VERSION=3.0.18 DB=sqlite
# ec-cube 3.0
- ECCUBE_VERSION=3.0 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- ECCUBE_VERSION=3.0 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- ECCUBE_VERSION=3.0 DB=sqlite
matrix:
fast_finish: true
include:
- php: 5.3
dist: precise
allow_failures:
- 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.0
env: ECCUBE_VERSION=3.0.9 DB=sqlite
- php: 7.0
env: ECCUBE_VERSION=3.0.10 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- php: 7.0
env: ECCUBE_VERSION=3.0.10 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- php: 7.0
env: ECCUBE_VERSION=3.0.10 DB=sqlite
- 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
- php: 7.1
env: ECCUBE_VERSION=3.0.9 DB=sqlite
- php: 7.1
env: ECCUBE_VERSION=3.0.10 DB=mysql USER=root DBNAME=myapp_test DBPASS=' ' DBUSER=root
- php: 7.1
env: ECCUBE_VERSION=3.0.10 DB=pgsql USER=postgres DBNAME=myapp_test DBPASS=password DBUSER=postgres
- php: 7.1
env: ECCUBE_VERSION=3.0.10 DB=sqlite
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}' = '3.0' ]; then git checkout -b ${ECCUBE_VERSION} origin/${ECCUBE_VERSION}; fi"
- sh -c "if [ '${ECCUBE_VERSION}' = '3.1' ]; then git checkout -b ${ECCUBE_VERSION} origin/${ECCUBE_VERSION}; fi"
- sh -c "if [ ! '${ECCUBE_VERSION}' = '3.1' -a ! '${ECCUBE_VERSION}' = '3.0' ]; 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}
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} || exit 1
# uninstall plugin
- php app/console plugin:develop uninstall --code=${PLUGIN_CODE} || exit 1
# re install plugin
- php app/console plugin:develop install --code=${PLUGIN_CODE} || exit 1
# re enable plugin
- php app/console plugin:develop enable --code=${PLUGIN_CODE} || exit 1
after_success:
# for coveralls
- if [[ $TRAVIS_PHP_VERSION =~ ^[7] ]]; then php vendor/bin/coveralls -v -x coverage.clover ; fi