psalm-plugin-phpunit/.travis.yml
Bruce Weirdan d3c96627cd
Cache effectively (#59)
* Cache composer cache, don't cache vendor

Instead of caching the vendor folder (which changes for every job, as
different levels of dependencies are installed) we now cache composer
cache folders (where it stores downloaded packages and cloned repos).
This should make caching much more effective, without introducing any
persistance issues (as metadata used for dependency resolution is not
cached).

* Allow vendor changes autodiscard

`ocramius/package-versions` changes the file it installs, so composer
may notice this (when the package is installed from source?) and refuse
upgrade/downgrade.
2020-04-01 13:08:24 +03:00

44 lines
1.2 KiB
YAML

language: php
php:
- 7.1
- 7.2
- 7.3
- 7.4
before_install:
- phpenv config-rm xdebug.ini || true
install:
- composer config --global discard-changes true
- travis_retry composer install
- if [[ "$DEPS" = 'high' || "$DEPS" = 'dev' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS update; fi
- if [[ "$DEPS" = 'high' ]]; then composer require $DEFAULT_COMPOSER_FLAGS --prefer-stable --update-with-dependencies vimeo/psalm; fi
- if [[ "$DEPS" = 'low' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-lowest --prefer-stable update; fi
- if [[ "$DEPS" = 'stable' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-stable update; fi
- ./vendor/bin/psalm --version
script: composer check
env:
matrix:
- DEPS="low"
- DEPS="high"
- DEPS="stable"
- DEPS="dev"
global:
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-suggest"
cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.composer/cache/vcs
allow_failures:
- php: 7.1
env: DEPS="dev"
- php: 7.2
env: DEPS="dev"
- php: 7.3
env: DEPS="dev"
- php: 7.4
env: DEPS="dev"