build: false
clone_depth: 1
clone_folder: c:\projects\google-cloud

cache:
  - vendor -> composer.json

init:
  - SET PATH=c:\Program Files\OpenSSL;c:\tools\php;%PATH%
  - SET COMPOSER_NO_INTERACTION=1

environment:
  matrix:
    - PHP_VERSION: 5.5
    - PHP_VERSION: 5.6
    - PHP_VERSION: 7.0
    - PHP_VERSION: 7.1
    - PHP_VERSION: 7.2

install:
  - cinst -y OpenSSL.Light
  - ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:PHP_VERSION | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
  - cd c:\tools\php
  - echo extension_dir=ext >> php.ini
  - echo extension=php_openssl.dll >> php.ini
  - cd c:\projects\google-cloud
  - appveyor DownloadFile https://getcomposer.org/download/1.2.1/composer.phar
  - php composer.phar self-update
  - php composer.phar install

test_script:
  - cd c:\projects\google-cloud
  - vendor/bin/phpunit
