version: 'test-{build}'
environment:
  matrix:
    - nodejs_version: '4'
    - nodejs_version: '6'
    - nodejs_version: '8'
platform:
  - x86
  - x64
cache:
    - c:\php -> appveyor.yml
init:
    - SET PATH=c:\php\71;%PATH%
    - SET PHP_PATH=c:\php\71\php-cgi.exe
clone_folder: 'c:\projects\%APPVEYOR_PROJECT_NAME%'
install:
  - IF EXIST c:\php\71 (SET PHP=0) ELSE (SET PHP=1)
  - IF %PHP%==1 mkdir c:\php\71
  - IF %PHP%==1 cd c:\php\71
  - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-7.1.0-Win32-VC14-x64.zip
  - IF %PHP%==1 7z x php-7.1.0-Win32-VC14-x64.zip >nul
  - set PATH=c:\php\71\;%PATH%
  - c:\php\71\php-cgi.exe -v
  - cd c:\projects\%APPVEYOR_PROJECT_NAME%
  - ps: 'Install-Product node $env:nodejs_version $env:platform'
  - npm install
test_script:
  - echo %cd%
  - node --version
  - npm --version
  - npm test
build: 'off'
