This repository has been archived by the owner on Sep 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
150 lines (128 loc) · 8.77 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
sudo: false
language: php
php:
- 5.5
- 5.6
- 7.0
addons:
apt:
packages:
- graphviz
- gdb
env:
global:
- CORE_BRANCH=stable9.1
- APP_NAME=galleryplus
- GH_REF: github.com/interfasys/galleryplus.git
- secure: "dc7Xn4XKenoqsO3pNIogOjlji3UeFQ9btysy+kM/6RWgC/wBHuUwmFPoCvrFJgs+BBsV8MXCvJyT0qsGfUZ25FqFK8CgoqRsyuocT1ewRhk/KZSmAVGe1mSsTMc1SUTtbcadUDe8WBa3tXcjs1ejWCpR46JyESCC5tq1WswJpbilXrYpQ+1WslOCWXxPeZKYRLLFyQ8Echlz5fP3SGNUdSo2ycDF0sbBH5jNsHXPce8FZaUOnFSPWOF7nbCgGSTIvskq5HjC6q/2dfj9Ir2PVNFI2i/jF1fTwgwZU8mHp8nSZCTFhdP30q3aKt/hyx6IKFF3K4rYut0mncpVY1mlST8Rl7VWecSQoBdgtJAH6cgJU+D1pYcboSNSZBiwX64Dzp0MTjOHtsqzUYinqGlMO0gYHcPt7EOytiAO46QSVMRaOGcaqnt5yT0NTVOiYcoV7X3KhztFN/Yl4SAjZjSDSS7XShgAPtxF+ye5B6N0q3fcOOY5lCNbarXuEedFMAD6K5/J4E7znK5OyPTGbk1N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sIud+PC82fronHRi783ohCj9LSm/Pzn+j7AkIF7olHjhOVV6J5ClsoQEYfgyxyjXSw7l6zhgAcT+r/4wY+ckc2x3Kleds0HvU5Fl3UXGOG3MpZWvhPTOc7o3E4M4qYwP9szKCXK+R6+BEhEp6jKem+3OoMDI75tUap5VKJQp8XKdnQyju2mDEj8gACllltw1TZJ0LxX4Rt+5hTVJcj3izmXu35bvVXIgCZC3Iwul3E0YnGvu4CtdT/uGHRWOifipCQyVMZAe74Syw0Iq/v79wymbZTOchmmzGeWzx79yeFkSbEN98p2nN0p7cS5/OULMgx1QyPqN9C7doeqUrVGgVU4wWlvnI0o2PSRz8485FtqXLIv7JET5oKeNYzWtW3aavLOn24ZOkJGOLsscIEzn70P1fTEPGNTq3PCcOCFmS+LEk5e3wxU/RdwihZMET4m1fxfsryW3eprz6ddJ6bpUf8="
matrix:
- DB=sqlite
branches:
only:
- master
- /^stable\d+(\.\d+)?$/
cache:
directories:
# ${TRAVIS_BUILD_DIR} is /home/travis/build/interfasys/galleryplus/
- ${TRAVIS_BUILD_DIR}/travis/php-cache
- ${TRAVIS_BUILD_DIR}/travis/lib-cache
- $HOME/.composer/cache
before_cache:
# Archive the vendor folder. Watch closely!
- cp -r ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME/vendor ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum`
before_install:
# Disable opcache on PHP 7.0 as it crashes too easily
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ]; then sed -i '/opcache.so/d' ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;"
- php --modules
# Setup Selenium
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- sh -c "if [ ! -e ${TRAVIS_BUILD_DIR}/travis/lib-cache/selenium.jar ]; then wget -O ${TRAVIS_BUILD_DIR}/travis/lib-cache/selenium.jar https://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.0.jar; fi;"
- java -jar ${TRAVIS_BUILD_DIR}/travis/lib-cache/selenium.jar -port 4444 >/dev/null 2>&1 & # WARNING - Takes a long time to start up. Keep here
# Ghostdriver does not work on Travis - Download the latest PhantomJS
#- mkdir travis-phantomjs
#- sh -c "if [ ! -e ${TRAVIS_BUILD_DIR}/travis/lib-cache/phantomjs.tar.bz2 ]; then wget -O ${TRAVIS_BUILD_DIR}/travis/lib-cache/phantomjs.tar.bz2 https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2; fi;"
#- tar -xvf ${TRAVIS_BUILD_DIR}/travis/lib-cache/phantomjs.tar.bz2
#- export PATH=${TRAVIS_BUILD_DIR}/travis/lib-cache/phantomjs:$PATH
#- phantomjs --webdriver=4444 --ignore-ssl-errors=true --webdriver-loglevel=DEBUG &
# Get rid of Github limits
# Only enable temporarily when making large package changes with composer
#- git config --global github.accesstoken $GH_TOKEN
# Make modifications to the environment to allow us to retrieve core dumps
# When debugging, make sure you enable sudo by commenting out the first line of this file
#- ulimit -c unlimited -S
#- cat /proc/sys/kernel/core_pattern
#- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ]; then echo '/tmp/core_%e.%p' | sudo tee /proc/sys/kernel/core_pattern; fi;"
#- cat /proc/sys/kernel/core_pattern
# Installing ownCloud
- wget https://raw.githubusercontent.com/owncloud/administration/master/travis-ci/before_install.sh
- bash ./before_install.sh $APP_NAME $CORE_BRANCH $DB
- cd ../core
- php occ app:enable $APP_NAME
before_script:
# Make sure Webdriver is running
- curl http://localhost:4444/wd/hub/status
#- phantomjs --version
# Install the Imagick PHP extension
- sh -c "pecl config-set preferred_state beta; echo yes | printf "\n" | pecl install imagick;"
# Disable xdebug when we don't need coverage to speed up testing
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then phpenv config-rm xdebug.ini; fi;"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' != 'mysql' ]; then phpenv config-rm xdebug.ini; fi;"
# Always install the latest version of the xdebug PHP extension
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then cd build; bash xdebug_install.sh; cd ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME; fi"
# Sets up the PHP composer cache
- sh -c "if [ ! -d ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum` ]; then mkdir -p ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum`; fi;"
- rm -rf ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME/vendor
- sh -c "if [ -d ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum`/vendor ]; then cp -r ${TRAVIS_BUILD_DIR}/travis/php-cache/`php-config --vernum`/vendor ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME; fi;"
# Composer
- cd ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME
- composer self-update
- composer config github-oauth.github.com ${GH_TOKEN}
- composer install -o --prefer-dist --no-interaction
- composer show -i
script:
# Test lint
- php vendor/bin/parallel-lint --exclude vendor/composer/autoload_static.php --exclude travis --exclude vendor . vendor/composer vendor/symfony/yaml vendor/autoload.php
# Acceptance tests, using Firefox, without code coverage
- php vendor/bin/codecept run acceptance --env firefox
# Unit, integration and api tests, without code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' != '7.0' ]; then php vendor/bin/codecept run unit,integration,api; fi;"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' != 'mysql' ]; then php vendor/bin/codecept run unit,integration,api; fi;"
# PHP 5.6 ONLY: Unit, integration and api tests with code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then php vendor/bin/codecept run unit,integration,api --coverage --coverage-xml --coverage-html; fi;"
# We can't use phpdbg only as it doesn't work with the webdriver and we can't use it for some tests only as we can't merge html reports
# - sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then phpenv config-rm xdebug.ini; phpdbg -qrr vendor/bin/codecept run unit,integration,api --coverage --coverage-xml --coverage-html; fi;"
after_success:
# Send coverage report to Scrutinizer
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml; fi"
# Generate API documentation
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then php vendor/bin/phpdoc run; fi"
# Generate Wiki documentation
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then git submodule update --init; fi"
# Send documentation to Github Pages
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '7.0' ] && [ '$DB' = 'mysql' ]; then cd build/documentation; bash ./docpublisher.sh; fi"
after_failure:
- cat tests/_output/phpbuiltinserver.errors.txt
- bash build/after_failure.sh
after_script:
# Codacy coverage report
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then php vendor/bin/codacycoverage clover tests/_output/coverage.xml; fi;"
# Codeclimate coverage report
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then php vendor/bin/test-reporter --coverage-report=tests/_output/coverage.xml; fi;"
matrix:
include:
- php: 5.5
env: DB=mysql
- php: 5.5
env: DB=pgsql
- php: 5.6
env: DB=mysql
- php: 7.0
env: DB=mysql
fast_finish: true