|
| 1 | +build: false |
| 2 | +platform: |
| 3 | + - x64 |
| 4 | +clone_folder: c:\projects\php-project-workspace |
| 5 | + |
| 6 | +## Build matrix for lowest and highest possible targets |
| 7 | +environment: |
| 8 | + matrix: |
| 9 | + - dependencies: lowest |
| 10 | + php_ver_target: 7.0 |
| 11 | + - dependencies: lowest |
| 12 | + php_ver_target: 7.1 |
| 13 | + - dependencies: current |
| 14 | + php_ver_target: 7.0 |
| 15 | + - dependencies: current |
| 16 | + php_ver_target: 7.1 |
| 17 | + - dependencies: highest |
| 18 | + php_ver_target: 7.0 |
| 19 | + - dependencies: highest |
| 20 | + php_ver_target: 7.1 |
| 21 | + |
| 22 | +## Cache composer bits |
| 23 | +cache: |
| 24 | + - '%LOCALAPPDATA%\Composer\files -> composer.lock' |
| 25 | + |
| 26 | +## Set up environment varriables |
| 27 | +init: |
| 28 | + - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH% |
| 29 | + - SET COMPOSER_NO_INTERACTION=1 |
| 30 | + - SET PHP=1 |
| 31 | + - SET ANSICON=121x90 (121x90) |
| 32 | + |
| 33 | +## Install PHP and composer, and run the appropriate composer command |
| 34 | +install: |
| 35 | + - IF EXIST c:\tools\php (SET PHP=0) |
| 36 | + - ps: appveyor-retry cinst -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $Env:php_ver_target | Select-Object -first 1) -replace '[php|]','') |
| 37 | + - cd c:\tools\php |
| 38 | + - IF %PHP%==1 copy php.ini-production php.ini /Y |
| 39 | + - IF %PHP%==1 echo date.timezone="UTC" >> php.ini |
| 40 | + - IF %PHP%==1 echo extension_dir=ext >> php.ini |
| 41 | + - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini |
| 42 | + - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini |
| 43 | + - IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini |
| 44 | + - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat |
| 45 | + - appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar |
| 46 | + - cd c:\projects\php-project-workspace |
| 47 | + - IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --profile -n |
| 48 | + - IF %dependencies%==current appveyor-retry composer install --no-progress --profile |
| 49 | + - IF %dependencies%==highest appveyor-retry composer update --no-progress --profile -n |
| 50 | + - composer show |
| 51 | + |
| 52 | +## Run the actual test |
| 53 | +test_script: |
| 54 | + - cd c:\projects\php-project-workspace |
| 55 | + - vendor/bin/phpunit -c phpunit.xml.dist |
0 commit comments