forked from owncloud/gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
114 lines (97 loc) · 4.91 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
sudo: false
language: php
php:
- 5.4
- 5.5
- 5.6
- 7
- hhvm
env:
global:
- CORE_BRANCH=master
- APP_NAME=gallery
- GH_REF: github.com/owncloud/gallery.git
- secure: "cLmMqrbVZrvn2GAoVs6JWa5h70tzrAISjPZUfENjl0KYT6B84z3B94W/dGU+I2mxwvyBqEP+x83Bih2CxEflqc7tJmdqC+MM/ZZiigPX7RCjq5XHbzUpPpMbC8MFxT2K3jcFXUitfwZvNaZXJIiK3ZQJU4ayKaegLvI91x1SqH0="
matrix:
- DB=sqlite
branches:
only:
- master
- /^stable\d+(\.\d+)?$/
cache:
directories:
# ${TRAVIS_BUILD_DIR} is /home/travis/build/owncloud/gallery/
- ${TRAVIS_BUILD_DIR}/travis/php-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:
# Setup Selenium
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
- wget https://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.0.jar
- java -jar selenium-server-standalone-2.47.0.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
#- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
#- tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs
#- export PATH=$PWD/travis-phantomjs:$PATH
#- phantomjs --webdriver=4444 --ignore-ssl-errors=true --webdriver-loglevel=DEBUG &
# Getting dependencies
# Graphviz. Disabled on Travis because it requires sudo and will be replaced by proper diagrams
#- sudo apt-get -qq update > /dev/null
#- sudo apt-get -qq install graphviz > /dev/null
#- phpenv rehash > /dev/null
# 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
# Sets up the 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 install -o --prefer-dist --no-interaction
before_script:
# Make sure Webdriver is running
- curl http://localhost:4444/wd/hub/status
#- phantomjs --version
# Install the Imagick PHP extension
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ]; then printf "\n" | pecl install imagick; fi;"
# Disable xdebug when we don't need coverage to speed up testing
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ] && [ '$TRAVIS_PHP_VERSION' != '7' ] && [ '$TRAVIS_PHP_VERSION' != '5.6' ]; then phpenv config-rm xdebug.ini; fi;"
# Install a newer xdebug PHP extension for PHP 5.6
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then cd build; bash xdebug_install.sh; cd ${TRAVIS_BUILD_DIR}/../core/apps/$APP_NAME; fi"
script:
# Test lint
- php vendor/bin/parallel-lint --exclude travis --exclude vendor . vendor/composer vendor/symfony/yaml vendor/autoload.php
# Acceptance tests, using Firefox, without code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ] && [ '$TRAVIS_PHP_VERSION' != '7' ]; then php vendor/bin/codecept run acceptance --env firefox; fi;"
# Unit, integration and api tests, without code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' != 'hhvm' ] && [ '$TRAVIS_PHP_VERSION' != '7' ] && [ '$TRAVIS_PHP_VERSION' != '5.6' ]; then php vendor/bin/codecept run api,integration,unit; fi;"
# PHP 5.6 ONLY: Unit, integration and api tests with code coverage
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then php vendor/bin/codecept run api,integration,unit --coverage --coverage-xml --coverage-html; fi;"
# Send coverage report to Scrutinizer
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then php ocular.phar code-coverage:upload --format=php-clover tests/_output/coverage.xml; fi"
# Generate API documentation
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then php vendor/bin/phpdoc run; fi"
# Generate Wiki documentation
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then git submodule update --init; fi"
# Send documentation to Github Pages
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.6' ]; then cd build/documentation; bash ./docpublisher.sh; fi"
matrix:
include:
- php: 5.4
env: DB=mysql
- php: 5.4
env: DB=pgsql
allow_failures:
- php: hhvm
- php: 7
fast_finish: true