1
0
Fork 0
composer/.travis.yml

97 lines
2.4 KiB
YAML

language: php
dist: bionic
git:
depth: 5
cache:
directories:
- $HOME/.composer/cache
matrix:
include:
- php: 5.3
dist: precise
env:
- PHP_LINT=1
- php: 5.4
dist: trusty
- php: 5.5
dist: trusty
- php: 5.6
dist: xenial
- php: 7.0
dist: xenial
- php: 7.1
dist: xenial
- php: 7.2
dist: xenial
- php: 7.3
dist: xenial
# Regular 7.4 build with locked deps
- php: 7.4
env:
- SYMFONY_PHPUNIT_VERSION=7.5
# High deps check
- php: 7.4
env:
- deps=high
- SYMFONY_PHPUNIT_VERSION=7.5
# PHPStan checks
- php: 7.4
env:
- deps=high
- PHPSTAN=1
- SYMFONY_PHPUNIT_VERSION=7.5
- php: nightly
fast_finish: true
allow_failures:
- php: nightly
before_install:
# disable Xdebug if available
- phpenv config-rm xdebug.ini || echo "xdebug not available"
# disable default memory limit
- export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo memory_limit = -1 >> $INI
- composer validate
install:
# flags to pass to install
- flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-progress"
# update deps to latest in case of high deps build
- if [ "$deps" == "high" ]; then composer config platform.php 7.4.0; composer update $flags; fi
# install dependencies using system provided composer binary
- composer install $flags
# install dependencies using composer from source
- bin/composer install $flags
before_script:
# make sure git tests do not complain about user/email not being set
- git config --global user.name travis-ci
- git config --global user.email travis@example.com
script:
- if [[ "$PHP_LINT" == "1" ]]; then find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f; fi
- if [[ $PHPSTAN == "1" ]]; then
bin/composer require --dev phpstan/phpstan:^0.12 phpunit/phpunit:^7.5 --no-update &&
bin/composer update phpstan/* phpunit/* sebastian/* --with-all-dependencies &&
vendor/bin/phpstan analyse --configuration=phpstan/config.neon;
else
vendor/bin/simple-phpunit;
fi
before_deploy:
- php -d phar.readonly=0 bin/compile
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: composer.phar
skip_cleanup: true
on:
tags: true
repo: composer/composer
php: '7.3'