forked from marc-mabe/php-enum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
72 lines (64 loc) · 2.09 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
sudo: false
language: php
cache:
directories:
- $HOME/.composer/cache
- $HOME/.local
- $HOME/ocular.phar
- $HOME/phpDocumentor.phar
env:
global:
- CODE_COVERAGE="0"
- PHPDOC="0"
matrix:
fast_finish: true
include:
- php: 7.1
env:
- CODE_COVERAGE="1"
- php: 7.2
env:
- CODE_COVERAGE="1"
- PHPDOC="1"
- php: 7.3
env:
- CODE_COVERAGE="1"
- php: nightly
allow_failures:
- php: nightly
install:
- if [ "${CODE_COVERAGE}" == "0" ]; then
phpenv config-rm xdebug.ini || return 0;
fi
- if [ "${CODE_COVERAGE}" == "1" ]; then
wget -q -N -t 3 --retry-connrefused 'https://scrutinizer-ci.com/ocular.phar' || return 0;
fi
- if [ "${PHPDOC}" == "1" ]; then
wget -q -N -t 3 --retry-connrefused 'https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar' || return 0;
composer require --no-update --dev "evert/phpdoc-md:~0.2.0" || return 0;
fi
- composer install -n
script:
- if [ "$CODE_COVERAGE" == "1" ]; then
php -d 'zend.assertions=1' vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.clover;
else
php -d 'zend.assertions=1' vendor/bin/phpunit --verbose;
fi
# run benchmarks to make sure they are working fine
- php vendor/bin/phpbench run --no-interaction --revs=1 --retry-threshold=100
after_script:
- if [ "${CODE_COVERAGE}" == "1" ]; then
php ocular.phar code-coverage:upload --format=php-clover coverage.clover;
fi
- if [ "${PHPDOC}" == "1" ]; then
git clone "https://${CI_USER_TOKEN}@github.com/marc-mabe/php-enum.wiki.git" &&
php phpDocumentor.phar -d src -t docs/ --template="xml" &&
php vendor/bin/phpdocmd --lt '%c' --index 'Home.md' docs/structure.xml php-enum.wiki/ &&
cp php-enum.wiki/Home.md php-enum.wiki/_Sidebar.md &&
cd php-enum.wiki/ &&
git add . &&
git commit -m "auto generated PHP doc" &&
git push origin master:master;
fi
notifications:
email: false