Rework appveyor
MODIFY
appveyor.yml
appveyor.yml
@@ -6,7 +6,7 @@ clone_folder: c:\projects\behat
environment:
matrix:
- - PHP_DOWNLOAD_FILE: php-7.1.3-Win32-VC14-x86.zip
+ - php: 7.2
branches:
only:
@@ -16,31 +16,48 @@ skip_commits:
message: /\[ci skip\]/
cache:
- - c:\php -> appveyor.yml
+ - C:\ProgramData\chocolatey\bin -> appveyor.yml
+ - C:\ProgramData\chocolatey\lib -> appveyor.yml
+ - C:\tools\php -> appveyor.yml
+ - C:\tools\composer -> appveyor.yml
+ - '%LOCALAPPDATA%\Composer\files'
init:
- - SET PATH=c:\php;%PATH%
+ - SET PATH=C:\Program Files\OpenSSL;c:\tools\php;C:\tools\composer;%PATH%
- SET COMPOSER_NO_INTERACTION=1
- - SET PHP=1
- SET ANSICON=121x90 (121x90)
- git config --global core.autocrlf input
install:
- - IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
- - cd c:\php
- - IF %PHP%==1 appveyor DownloadFile https://github.com/symfony/binary-utils/releases/download/v0.1/%PHP_DOWNLOAD_FILE%
- - IF %PHP%==1 7z x %PHP_DOWNLOAD_FILE% -y > 7z.log
- - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- - appveyor DownloadFile https://getcomposer.org/composer.phar
- - 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
- - echo extension=php_curl.dll >> php.ini
- - echo extension=php_mbstring.dll >> php.ini
- - echo extension=php_fileinfo.dll >> php.ini
+ - ps: |
+ if (!(Test-Path c:\tools\php)) {
+ 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 | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
+ Get-ChildItem -Path c:\tools\php
+ cd c:\tools\php
+
+ # Set PHP environment items that are always needed
+ copy php.ini-production php.ini
+ Add-Content php.ini "`n date.timezone=UTC"
+ Add-Content php.ini "`n extension_dir=ext"
+ Add-Content php.ini "`n extension=php_openssl.dll"
+ Add-Content php.ini "`n extension=php_curl.dll"
+ Add-Content php.ini "`n extension=php_mbstring.dll"
+ Add-Content php.ini "`n extension=php_fileinfo.dll"
+
+ # download Composer
+ if (!(Test-Path C:\tools\composer)) {
+ New-Item -path c:\tools -name composer -itemtype directory
+ }
+
+ if (!(Test-Path c:\tools\composer\composer.phar)) {
+ appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar -Filename C:\tools\composer\composer.phar
+ Set-Content -path 'C:\tools\composer\composer.bat' -Value ('@php C:\tools\composer\composer.phar %*')
+ }
+ }
+
- cd c:\projects\behat
- - composer install --no-progress --ansi
+ - appveyor-retry composer self-update
+ - appveyor-retry composer install --no-progress --ansi
test_script:
- cd c:\projects\behat

Rework appveyor