2016-10-22 20:43:25 +00:00
#
2016-12-05 19:23:59 +00:00
# Travis-CI configuration file for Hubzilla
2016-10-22 20:43:25 +00:00
#
## configure things
#
2015-10-28 00:36:25 +00:00
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language : php
2016-12-05 19:23:59 +00:00
# use newer 'trusty' based distro, old one is 'precise'
dist : trusty
2016-10-22 20:43:25 +00:00
# use docker based containers
sudo : false
# Git branches whitelist to build on Travis CI
branches :
only :
- master
- dev
2017-03-10 00:01:35 +00:00
# whitelist our tags for release deployments e.g. 2.2
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
2015-10-28 00:36:25 +00:00
2016-10-22 20:43:25 +00:00
# Install additional software
addons :
# Install dependencies for generating API documentation with doxygen
apt :
packages :
2016-12-05 19:23:59 +00:00
- doxygen
- doxygen-latex
2016-10-22 20:43:25 +00:00
- graphviz
- ttf-liberation
2015-10-28 00:36:25 +00:00
2017-01-27 20:56:21 +00:00
# enable and start databases on a per job basis
2016-10-22 20:43:25 +00:00
#services:
# - mariadb
# - postgresql
2017-02-05 00:38:12 +00:00
# any PHP version we want to test against, current stable phpunit requires PHP >= 7.0
2016-10-22 20:43:25 +00:00
php :
- '7.0'
2016-12-05 19:23:59 +00:00
- '7.1'
2017-11-24 22:38:41 +00:00
- '7.2'
2017-02-05 00:38:12 +00:00
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
2016-12-05 19:23:59 +00:00
#- 'hhvm'
2015-10-28 00:36:25 +00:00
2016-10-22 20:43:25 +00:00
# list of environments to test
env :
global :
# used for doxygen deployment script
- DOXYFILE : $TRAVIS_BUILD_DIR/util/Doxyfile
# Uncomment if a newer/specific version of Doxygen should be used
#- DOXY_VER: 1.8.12
2016-12-05 19:23:59 +00:00
# Code Coverage is slow, no need to have it in every build
- PHPUCOV : "--no-coverage"
2016-10-22 20:43:25 +00:00
# use matrix only for PHP and MySQL, all other combinations added through includes
matrix :
2017-01-27 20:56:21 +00:00
# trusty default MySQL 5.6
- DB=mysql MYSQL_VERSION=5.6
2016-10-22 20:43:25 +00:00
# Matrix configuration details
2015-10-28 00:36:25 +00:00
matrix :
2016-10-22 20:43:25 +00:00
fast_finish : true
# Additional check combinations
include :
2018-03-17 20:47:02 +00:00
# PHP7.2, mariadb 10.2
- php : '7.2'
env : DB=mariadb MARIADB_VERSION=10.2 CODECOV=1
2016-10-22 20:43:25 +00:00
# use mariadb instead of MySQL
addons :
2018-03-17 20:47:02 +00:00
mariadb : '10.2'
# PHP7.2, PostgreSQL 9.6
- php : '7.2'
2017-11-24 22:38:41 +00:00
env : DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
2016-12-05 19:23:59 +00:00
# Use newer postgres than 9.2 default
2016-10-22 20:43:25 +00:00
addons :
2016-12-05 19:23:59 +00:00
postgresql : '9.6'
services :
- postgresql
2018-03-17 20:47:02 +00:00
# PostgreSQL 10 with Docker container
- php : '7.2'
env : DB=pgsql POSTGRESQL_VERSION=10 PHPUNITFILE=phpunit-pgsql.xml
sudo : required
services :
- docker
# PHP7.2, old precise distribution with MySQL 5.5
- php : '7.2'
2017-01-27 20:56:21 +00:00
env : DB=mysql MYSQL_VERSION=5.5
dist : precise
services :
- mysql
2017-06-05 18:32:00 +00:00
# MySQL 5.7 with Docker container
2018-03-17 20:47:02 +00:00
- php : '7.2'
2017-06-05 18:32:00 +00:00
env : DB=mysql MYSQL_VERSION=5.7
sudo : required
services :
- docker
2017-01-27 20:56:21 +00:00
# Excludes from default matrix combinations
2015-10-28 00:36:25 +00:00
# exclude:
# - php: hhvm
# env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support)
2016-10-22 20:43:25 +00:00
# cache composer downloads between runs
cache :
directories :
- $HOME/.composer/cache
2016-12-05 19:23:59 +00:00
#- $HOME/doxygen/doxygen-$DOXY_VER/bin
2016-10-22 20:43:25 +00:00
2015-10-28 00:36:25 +00:00
2016-10-22 20:43:25 +00:00
#
## execute things
#
before_install :
- travis_retry composer self-update
2017-06-05 18:32:00 +00:00
# Start MySQL 5.7 Docker container, needs some time to come up
- if [[ "$MYSQL_VERSION" == "5.7" ]]; then sudo service mysql stop; docker run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.7 && sleep 25 && docker ps; fi
2018-03-17 20:47:02 +00:00
# Start PostgreSQL 10 Docker container, needs some time to come up
- if [[ "$POSTGRESQL_VERSION" == "10" ]]; then sudo service postgresql stop; docker run -d -p 5432:5432 postgres:10-alpine && sleep 35 && docker ps; fi
2016-10-22 20:43:25 +00:00
# Install composer dev libs
2016-10-18 22:53:08 +00:00
install :
2017-05-05 21:13:54 +00:00
- travis_retry composer install --optimize-autoloader --no-progress
2016-10-22 20:43:25 +00:00
# execute any number of scripts before the test run, custom env's are available as variables
before_script :
2016-12-05 19:23:59 +00:00
# Use code coverage config for phpunit
- if [[ ! -z $CODECOV ]]; then export PHPUCOV=""; fi
2016-10-22 20:43:25 +00:00
# Some preparation tasks of environment
- ./tests/travis/prepare.sh
# DB specific prepare scripts
- if [[ "$DB" == "mysql" ]]; then ./tests/travis/prepare_mysql.sh; fi
- if [[ "$DB" == "mariadb" ]]; then ./tests/travis/prepare_mysql.sh; fi
- if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
2016-10-18 22:53:08 +00:00
2015-10-28 00:36:25 +00:00
# omitting "script:" will default to phpunit
2017-11-24 22:38:41 +00:00
script :
- ./vendor/bin/phpunit $PHPUCOV -c tests/$PHPUNITFILE
2016-10-22 20:43:25 +00:00
after_success :
2017-11-24 22:38:41 +00:00
- cat tests/results/testdox.txt
# Generate API documentation and prepare for deployment
2016-10-22 20:43:25 +00:00
- ./tests/travis/gen_apidocs.sh
2017-11-24 22:38:41 +00:00
after_failure :
- cat tests/results/testdox.txt
2016-10-22 20:43:25 +00:00
2017-03-10 00:01:35 +00:00
# Deploying release and API documentation to GitHub
2017-11-24 22:38:41 +00:00
before_deploy :
- if [[ "$CODECOV" == "1" ]]; then zip -9 -r -q tests/hubzilla-testresults.zip tests/results; fi
2017-03-10 00:01:35 +00:00
deploy :
- provider : pages
skip_cleanup : true
local_dir : $TRAVIS_BUILD_DIR/doc/html
github_token : $GH_TOKEN
on :
repo : redmatrix/hubzilla
branch : master
condition : '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
# add API documentation to release, could also be used to provide full packages if we want to drop vendor from our repo
- provider : releases
skip_cleanup : true
api_key : $GH_TOKEN
file : 'doc/hubzilla-api-documentation.zip'
on :
repo : redmatrix/hubzilla
tags : true
condition : '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
2017-11-24 22:38:41 +00:00
# add code coverage and test results to release
- provider : releases
skip_cleanup : true
api_key : $GH_TOKEN
file : 'tests/hubzilla-testresults.zip'
on :
repo : redmatrix/hubzilla
tags : true
condition : '(-n "$GH_TOKEN") && ("$CODECOV" == "1")'
2016-10-22 20:43:25 +00:00
#after_deploy:
#after_script:
2015-10-28 00:36:25 +00:00
# configure notifications (email, IRC, campfire etc)
2016-10-22 20:43:25 +00:00
#notifications:
2015-10-28 00:36:25 +00:00
# irc: "irc.freenode.org#yourfavouriteroomfortravis"
2016-10-18 22:53:08 +00:00
# a plugin/script to post to a hubzilla channel would be neat here