1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/.travis.yml
Barney Laurance 7ec9818192 Don't attempt to deploy phar from forked repos (#1720)
Only vimeo/psalm should be deploying
2019-06-01 09:32:12 -04:00

102 lines
3.4 KiB
YAML

dist: xenial
language: php
stages:
- Code style analysis
- test
- Phar build
- Code coverage analysis
php:
- 7.1
- 7.2
- 7.3
env:
matrix:
- DEPS="high"
- DEPS="low"
global:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-suggest --prefer-source"
- XDEBUG="false"
# generated with travis encrypt -r vimeo/psalm --org GITHUB_TOKEN="<secret oauth token>"
- secure: Ayjp10v6IWeJX3ThWvPxlv0gkuTuvu30lsdQCjop+vS0Kv+6/IEOdSOxtm0tEWacq9EFCViWRKh9zxiwPtoi0wxGdzGGws+UtIJxew6Vy8HDCEH8nY4k50eElKUWI4YhVbiSdZEZ+Bd9kO0qGEBH9iWh8Tc8MP2Hklx7lOf+zUTSm8vpv+idcCxwGCvQMaMc5NhfnkgGq95/UU3iOvCi5/wkIFnSnoccxmZE2zsxI1e355ipa0uoe8/Ml6vK0NrZ0aBZwZfItsIuhRcL4Cm5kyar+Ao/mn9Zw8CHbfESrIMomRI7ZxwPNFj+sR/wCvEasIGHRxH8B9F4d8SmAoHR1CrmM/zyWRon73CfRb56M4VGG1hyqTr1GYHpBgZKSOYA8TKyOjD8EHGvevfHpJoGVNxf0+vAfdizlVJvkYhzSz/VjpOZO8rfOct4deNcpCVuVGg5uOGeg5P7coVniGHLHTm3JozK9Ia+ZLePtr3l/NuoW5dXVF1fdroCyQS2X0VSXALnnTPzcIQYsmpCk8yJ8uXorxj4dJHhstyll1jemJjxT7HJ1ASPUOTsPu9u9EoBDHQxOGa5b2/7chyV+EhrYV899RKZ4xEPzpC619sWgtZJci3oLcebU1BY42pIr94UqtwcJKhriwV72VpKvCG/eqOKLhXq355TYRx2dK05a5w=
cache:
directories:
- ./vendor
before_install:
# determine INI file
- export INI_DIR=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d
- export INI=$INI_DIR/travis.ini
- if [[ "$TRAVIS_TAG" = '' ]]; then export COMPOSER_ROOT_VERSION=dev-master; fi
# disable default memory limit
- echo memory_limit = 2G >> $INI
- if [[ "$XDEBUG" = 'false' && -f $INI_DIR/xdebug.ini ]]; then phpenv config-rm xdebug.ini; fi
- composer clear-cache
install:
- if [[ "$DEPS" = 'high' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS update; fi
- if [[ "$DEPS" = 'low' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-lowest --prefer-stable update; fi
script:
- vendor/bin/phpunit
- ./psalm
# Base test matrix (php/env)
matrix:
fast_finish: true
allow_failures:
- php: nightly
exclude: # covered in Code coverage stage
- php: 7.3
env: DEPS="high"
# Additional stages
jobs:
include:
- stage: Code coverage analysis
php: 7.3
# don't disable xdebug here
env: XDEBUG="true"
install:
- composer $DEFAULT_COMPOSER_FLAGS update
- composer require --dev php-coveralls/php-coveralls
- mkdir -p build
before_script:
- vendor/bin/phpunit --dump-xdebug-filter build/xdebug-filter.php
script:
- vendor/bin/phpunit --prepend build/xdebug-filter.php
- ./psalm --shepherd
after_success:
- travis_retry php vendor/bin/php-coveralls -v
- stage: Code style analysis
php: 7.3
env: DEPS="high"
script:
- vendor/bin/phpcs
# always build phar, but only deploy on tag builds
- stage: Phar build
php: 7.3
env: DEPS="high"
script:
- bin/build-phar.sh
- if [[ "$TRAVIS_REPO_SLUG" = 'vimeo/psalm' && "$TRAVIS_PULL_REQUEST" = 'false' ]]; then bin/travis-deploy-phar.sh; fi
before_deploy:
- echo $GPG_ENCRYPTION | gpg --passphrase-fd 0 keys.asc.gpg
- gpg --batch --yes --import keys.asc
- echo $SIGNING_KEY | gpg --passphrase-fd 0 -u 8A03EA3B385DBAA1 --armor --detach-sig build/psalm.phar
- cd phar && git tag ${TRAVIS_TAG} && git push origin ${TRAVIS_TAG} && cd ..
deploy:
skip_cleanup: true
on:
tags: true
provider: releases
api_key: $GITHUB_TOKEN
file:
- build/psalm.phar
- build/psalm.phar.asc