Fetching contributors…
Cannot retrieve contributors at this time
78 lines (61 sloc) 2.78 KB
language: php
sudo: false
php: 7.1
# Token for, so Travis is able to push to "apigen/Api repository
# It must be encrypted in local repository
# See manual how to set it up:
- secure: jJuaecVvLaHk9/kQabIcCn3pZ5KaqC5VZQUnvU5UWzAJmUxoDBVCAkdAz1/F3VyWhBtiiYiTo2D+DFsIXiNYXRNMIHp5AE+tz4XgSiZUhqV81BvRtCgJSJIBsiyVmbKE5WAoHt/ovMKZY7StVVejmK3OfsbXOf1ewhpWsmNTI30=
# 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 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
# 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
# - ~/.composer/vendor/bin/apigen generate -h
# upload coverage.xml file to to analyze it
- wget
- php coveralls.phar --verbose
# Generate ApiGen's api a push it to, 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}
# Set Travis to Git Identity
git config --global ""
git config --global "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
# do not send emails
email: never