forked from HaakonME/hubzilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
178 lines (156 loc) · 5.04 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#
# Travis-CI configuration file for Hubzilla
#
## configure things
#
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
# use newer 'trusty' based distro, old one is 'precise'
dist: trusty
# use docker based containers
sudo: false
# Git branches whitelist to build on Travis CI
branches:
only:
- master
- dev
# whitelist our tags for release deployments e.g. 2.2
- /^\d+\.\d+(\.\d+)?(-\S*)?$/
# Install additional software
addons:
# Install dependencies for generating API documentation with doxygen
apt:
packages:
- doxygen
- doxygen-latex
- graphviz
- ttf-liberation
# enable and start databases on a per job basis
#services:
# - mariadb
# - postgresql
# any PHP version we want to test against, current stable phpunit requires PHP >= 7.0
php:
- '7.0'
- '7.1'
- '7.2'
# HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
#- 'hhvm'
# 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
# Code Coverage is slow, no need to have it in every build
- PHPUCOV: "--no-coverage"
# use matrix only for PHP and MySQL, all other combinations added through includes
matrix:
# trusty default MySQL 5.6
- DB=mysql MYSQL_VERSION=5.6
# Matrix configuration details
matrix:
fast_finish: true
# Additional check combinations
include:
# PHP7.1, mariadb 10.1
- php: '7.1'
env: DB=mariadb MARIADB_VERSION=10.1 CODECOV=1
# use mariadb instead of MySQL
addons:
mariadb: '10.1'
# PHP7.1, PostgreSQL 9.6
- php: '7.1'
env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
# Use newer postgres than 9.2 default
addons:
postgresql: '9.6'
services:
- postgresql
# PHP7.1, old precise distribution with MySQL 5.5
- php: '7.1'
env: DB=mysql MYSQL_VERSION=5.5
dist: precise
services:
- mysql
# MySQL 5.7 with Docker container
- php: '7.1'
env: DB=mysql MYSQL_VERSION=5.7
sudo: required
services:
- docker
# Excludes from default matrix combinations
# exclude:
# - php: hhvm
# env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support)
# cache composer downloads between runs
cache:
directories:
- $HOME/.composer/cache
#- $HOME/doxygen/doxygen-$DOXY_VER/bin
#
## execute things
#
before_install:
- travis_retry composer self-update
# 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
# Install composer dev libs
install:
- travis_retry composer install --optimize-autoloader --no-progress
# execute any number of scripts before the test run, custom env's are available as variables
before_script:
# Use code coverage config for phpunit
- if [[ ! -z $CODECOV ]]; then export PHPUCOV=""; fi
# 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
# omitting "script:" will default to phpunit
script:
- ./vendor/bin/phpunit $PHPUCOV -c tests/$PHPUNITFILE
after_success:
- cat tests/results/testdox.txt
# Generate API documentation and prepare for deployment
- ./tests/travis/gen_apidocs.sh
after_failure:
- cat tests/results/testdox.txt
# Deploying release and API documentation to GitHub
before_deploy:
- if [[ "$CODECOV" == "1" ]]; then zip -9 -r -q tests/hubzilla-testresults.zip tests/results; fi
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")'
# 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")'
#after_deploy:
#after_script:
# configure notifications (email, IRC, campfire etc)
#notifications:
# irc: "irc.freenode.org#yourfavouriteroomfortravis"
# a plugin/script to post to a hubzilla channel would be neat here