This repository has been archived by the owner on Dec 1, 2021. It is now read-only.
forked from ApiGen/ApiGen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
77 lines (61 loc) · 2.78 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
language: php
sudo: false
php: 7.1
env:
global:
# Token for generate-api.sh, so Travis is able to push to "apigen/Api repository
# It must be encrypted in https://github.com/ApiGen/api local repository
# See manual how to set it up: https://github.com/TomasVotruba/tomasvotruba.cz/blob/08f0df06674c6bc9db224a69250b8e95060cdc96/.travis.yml#L6-L15
- secure: jJuaecVvLaHk9/kQabIcCn3pZ5KaqC5VZQUnvU5UWzAJmUxoDBVCAkdAz1/F3VyWhBtiiYiTo2D+DFsIXiNYXRNMIHp5AE+tz4XgSiZUhqV81BvRtCgJSJIBsiyVmbKE5WAoHt/ovMKZY7StVVejmK3OfsbXOf1ewhpWsmNTI30=
before_install:
# Prevents global install of dev dependecies failing (due to Roave\BetterReflection:@dev)
- composer global config minimum-stability dev
- composer global config prefer-stable true
install:
# install composer dependencies
- composer install
# Create composer global installs
- composer create-project apigen/apigen:dev-master temp/apigen-project
- composer global require apigen/apigen:dev-master
script:
# run tests
- vendor/bin/phpunit --coverage-clover coverage.xml
# Turn off XDebug to make the rest faster
- phpenv config-rm xdebug.ini || return 0
# check coding standard (defined in composer.json "scripts" section)
- composer check-cs
# check with phpstan (defined in composer.json "scripts" section)
- composer phpstan
# Global install checks
- temp/apigen-project/bin/apigen generate -h
# disable for now, due to commit lock on opened PR
# https://github.com/ApiGen/ApiGen/commit/891bdf8c8090ee72028943bb9d06d1accda27daf
# https://github.com/Roave/BetterReflection/pull/312
# - ~/.composer/vendor/bin/apigen generate -h
after_script:
# upload coverage.xml file to Coveralls.io to analyze it
- wget https://github.com/satooshi/php-coveralls/releases/download/v1.0.1/coveralls.phar
- php coveralls.phar --verbose
# Generate ApiGen's api a push it to https://github.com/apigen/apigen, gh-pages branch
- |
if [[ $TRAVIS_BRANCH == "master" ]]; then
# Generate API for ApiGen
bin/apigen generate src --destination temp/api
# use this, when ApiGen is faster
# bin/apigen generate src packages/*/src --destination temp/api
cd temp/api
# Add this repository as remote
git init
git remote add origin https://${GH_TOKEN}@github.com/ApiGen/ApiGen.git
# Set Travis to Git Identity
git config --global user.email "[email protected]"
git config --global user.name "Travis"
# Add generated API
git add .
git commit -m "API Regenerated"
# Push current content to gh-pages branch
git push origin master:gh-pages -f
fi
# do not send emails
notifications:
email: never