This repository has been archived by the owner on Aug 1, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy path.travis.yml
58 lines (46 loc) · 1.65 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
#DOCS: http://docs.travis-ci.com/user/languages/php/
language: php
php:
- 7.2
- 7.3
services:
- mysql
sudo: false
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- libmysqlclient-dev
- libmysqlclient20
- mysql-community-client
- mysql-common
- mysql-community-server
# ssh_known_hosts: trackr.moe:22
env:
- CI_ENV=testing
cache:
directories:
- vendor
- $HOME/.composer/cache
matrix:
fast_finish: true
before_install:
- travis_retry composer self-update && composer --version #travis is bad at updating composer
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
#NOTE: Database creation is done in composer.json scripts.
install:
- composer setup-databases
- composer install -n --prefer-dist
- echo '<?php $db["default"]["username"] = "root"; $db["default"]["password"] = "";' > application/config/testing/database_password.php
- php public/index.php admin/migrate
script:
#phpunit testing
- cd application/tests/ && ../../vendor/bin/phpunit --coverage-clover=/tmp/coverage.clover --testsuite MainTestSuite && cd $TRAVIS_BUILD_DIR
# Fail if log contains errors.
# - ! cat application/logs/* | grep -q "ERROR - "
after_success:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover /tmp/coverage.clover
after_script:
- cd $TRAVIS_BUILD_DIR && cat application/logs/* | egrep -v '^DEBUG.*(Config file loaded|Global POST, GET and COOKIE|No URI present|CI_Session has already|Initialization under CLI|UTF-8 Support Enabled|Total execution time|Class Initialized|has already been instantiated).*'