From a98aafdc28c753a913215c764e8a4f2769b282b1 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 1 Jun 2017 12:15:27 +0200 Subject: [PATCH] travis: Add caching for vendor resources --- .travis.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 63ebc3d..516dabe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,23 @@ php: - '7.1' - nightly +cache: + directories: + - vendor + +env: + - ICINGAWEB_VERSION=2.4.1 PHPCS_VERSION=2.9.1 + before_script: + - test -d vendor || mkdir vendor # TODO: Re-enable after dropping 5.3 support: # - curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar - - curl -OL https://github.com/squizlabs/PHP_CodeSniffer/releases/download/2.9.1/phpcs.phar - - wget https://github.com/Icinga/icingaweb2/archive/v2.4.0.tar.gz - - tar xfz v2.4.0.tar.gz - - ln -s icingaweb2-2.4.0/library/Icinga - - ln -s icingaweb2-2.4.0/library/vendor/Zend + - test -e vendor/phpcs-${PHPCS_VERSION}.phar || wget -O vendor/phpcs-${PHPCS_VERSION}.phar https://github.com/squizlabs/PHP_CodeSniffer/releases/download/${PHPCS_VERSION}/phpcs.phar + - test -e vendor/v${ICINGAWEB_VERSION}.tar.gz || (cd vendor/ && wget https://github.com/Icinga/icingaweb2/archive/v${ICINGAWEB_VERSION}.tar.gz) + - test -d vendor/icingaweb2-${ICINGAWEB_VERSION} || (cd vendor && tar xfz v${ICINGAWEB_VERSION}.tar.gz) + - ln -s vendor/icingaweb2-${ICINGAWEB_VERSION}/library/Icinga + - ln -s vendor/icingaweb2-${ICINGAWEB_VERSION}/library/vendor/Zend script: - - php phpcs.phar + - php vendor/phpcs-${PHPCS_VERSION}.phar - phpunit --testdox || phpunit --verbose