forked from YOURLS/YOURLS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
66 lines (57 loc) · 1.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
language: php
env:
global:
- DB=mysql
- PHPUNIT_FLAGS='--no-coverage'
- TEST_COVERAGE=0
services:
- mysql
# https://phpunit.de/supported-versions.html
matrix:
include:
- php: 5.6
env: PHPUNIT_VERSION=5.7.*
- php: 7.0
env: PHPUNIT_VERSION=6.5.*
- php: 7.1
env: PHPUNIT_VERSION=7.5.*
- php: 7.2
env: PHPUNIT_VERSION=7.5.*
- php: 7.3
env: PHPUNIT_VERSION=7.5.*
- php: 7.4
env: PHPUNIT_VERSION=7.5.* TEST_COVERAGE=1 PHPUNIT_FLAGS='--coverage-clover clover.xml'
- php: nightly
env: PHPUNIT_VERSION=7.5.*
fast_finish: true
allow_failures:
- php: nightly
cache:
apt: true
directories:
# Cache directory for older Composer versions.
- $HOME/.composer/cache/files
# Cache directory for more recent Composer versions.
- $HOME/.cache/composer/files
install:
# Speed up build time by disabling Xdebug unless actually needed.
- if [ "$TEST_COVERAGE" != '1' ]; then phpenv config-rm xdebug.ini || echo 'No xdebug config.'; fi
- composer global require hirak/prestissimo --no-suggest --no-interaction
# Update tests/composer.json to overwrite phpunit with specific version
- composer require "phpunit/phpunit:${PHPUNIT_VERSION}" -d ./tests --dev --no-update --no-interaction --no-suggest
- composer install -d ./tests --no-suggest --no-interaction
before_script:
- mysql --version
- git clone git://github.com/ozh/YOURLS-fr_FR.git user/languages/fr
- cp user/languages/fr/fr_FR.* user/languages
- mysql -e 'create database IF NOT EXISTS yourls_tests;'
- cp tests/data/config/yourls-tests-config-travis.php user/config.php
script: tests/vendor/bin/phpunit --configuration ./phpunit-travis.xml.dist $PHPUNIT_FLAGS
after_script:
- |
if [ "$TEST_COVERAGE" == '1' ]; then
travis_retry wget https://scrutinizer-ci.com/ocular.phar;
travis_retry php ocular.phar code-coverage:upload --format=php-clover clover.xml;
fi
notifications:
email: false