build: false

platform:
  - x64

clone_folder: c:\projects\project-code

cache:
  - c:\ProgramData\chocolatey\bin -> .appveyor.yml
  - c:\ProgramData\chocolatey\lib -> .appveyor.yml
  - c:\ProgramData\ComposerSetup -> .appveyor.yml
  - c:\tools\php -> .appveyor.yml

environment:
  global:
    COMPOSER_NO_INTERACTION: 1
    ANSICON: 121x90 (121x90) # Console colors

  ffmpeg_download: https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-20191004-e6625ca-win64-static.zip

  matrix:
    - PHP_VERSION: Latest_Version

init:
  - ps: $env:PATH = 'c:\tools\php;c:\ProgramData\ComposerSetup\bin;' + $env:PATH

install:
  - ps: Set-Service wuauserv -StartupType Manual # Chocolatey will try to install Windows updates when installing PHP.
  - ps: cinst php --params '""/InstallDir:C:\tools\php""' --ignore-checksums
  - ps: Start-FileDownload $env:ffmpeg_download

  - 7z x ffmpeg-20191004-e6625ca-win64-static.zip
  - PATH=%PATH%;%cd%\ffmpeg-20191004-e6625ca-win64-static\bin
  - cd c:\tools\php
  - copy php.ini-production php.ini /Y
  - echo date.timezone="UTC" >> php.ini
  - echo extension_dir=ext >> php.ini
  - echo extension=php_openssl.dll >> php.ini # Needed to install Composer
  - echo extension=php_mbstring.dll >> php.ini # Needed for PHPunit
  - echo extension=php_fileinfo.dll >> php.ini

  - appveyor-retry cinst --no-progress -y composer

  - cd c:\projects\project-code
  - appveyor-retry composer update --no-interaction --no-progress --no-suggest --optimize-autoloader --prefer-stable --prefer-dist

test_script:
  - cd c:\projects\project-code
  - ffmpeg -version
  - vendor\bin\phpunit tests
