forked from phpstan/phpstan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
69 lines (64 loc) · 3.62 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
build: false
clone_depth: 50
platform:
- x64
environment:
matrix:
- dependencies: lowest
php_version: 7.0
- dependencies: highest
php_version: 7.0
- dependencies: lowest
php_version: 7.1
- dependencies: highest
php_version: 7.1
project_directory: c:\projects\phpstan
composer_directory: c:\tools\composer
composer_executable: c:\tools\composer\composer.phar
php_archive_directory: c:\tools\php-archive
php_directory: c:\tools\php
clone_folder: c:\projects\phpstan
cache:
- c:\tools\composer
- c:\tools\php-archive
- '%LOCALAPPDATA%\Composer'
init:
- ps: $Env:PATH = $Env:php_directory + ';' + $Env:composer_directory + ';' + $Env:PATH
- ps: $Env:ANSICON = '121x90 (121x90)'
install:
# Download requested PHP version
- ps: If ((Test-Path $Env:php_archive_directory) -eq $False) { New-Item -Path $Env:php_archive_directory -ItemType 'directory' }
- ps: $requested_php_version = %{If ($Env:dependencies -eq 'lowest') { $Env:php_version + '.0' } Else { (((choco search php --exact --all-versions -r | Select-String -pattern $Env:php_version) -replace '[php|]', '') | %{ New-Object System.Version $_ } | Sort-Object | Select-Object -Last 1).ToString() }}
- ps: $php_version_url = %{If ($Env:dependencies -eq 'lowest') { 'http://windows.php.net/downloads/releases/archives/php-' + $requested_php_version + '-nts-Win32-VC14-' + $Env:platform + '.zip' } Else { 'http://windows.php.net/downloads/releases/php-' + $requested_php_version + '-nts-Win32-VC14-' + $Env:platform + '.zip' }}
- ps: $php_version_file = $Env:php_archive_directory + '\php-' + $requested_php_version + '.zip'
- ps: If ((Test-Path $php_version_file) -eq $False) { appveyor-retry appveyor DownloadFile $php_version_url -FileName $php_version_file }
# Prepare PHP
- ps: New-Item -Path $Env:php_directory -ItemType 'directory'
- ps: cd $Env:php_directory
- ps: 7z x $php_version_file
- ps: Copy-Item php.ini-production -Destination php.init
- ps: Add-Content -Path php.ini -Value 'date.timezone="UTC"'
- ps: Add-Content -Path php.ini -Value 'extension_dir=ext'
- ps: Add-Content -Path php.ini -Value 'extension=php_curl.dll'
- ps: Add-Content -Path php.ini -Value 'extension=php_intl.dll'
- ps: Add-Content -Path php.ini -Value 'extension=php_mbstring.dll'
- ps: Add-Content -Path php.ini -Value 'extension=php_openssl.dll'
- ps: Add-Content -Path php.ini -Value 'extension=php_gd2.dll'
- ps: Add-Content -Path php.ini -Value 'extension=php_mysqli.dll'
- ps: php --version
# Prepare composer
- ps: If ((Test-Path $Env:composer_directory) -eq $False) { New-Item -Path $Env:composer_directory -ItemType 'directory' }
- ps: If ((Test-Path $Env:composer_executable) -eq $False) { appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar -FileName $Env:composer_executable }
- ps: Set-Content -Path ($Env:composer_directory + '\composer.bat') -Value ('@php ' + $Env:composer_executable + ' %*')
- composer self-update
# Install dependencies
- ps: cd $Env:project_directory
- IF %dependencies%==lowest composer update --prefer-lowest --no-interaction --no-progress
- IF %dependencies%==highest composer update --no-interaction --no-progress
# Apply patch to jakub-onderka/php-parallel-lint
- ps: appveyor-retry appveyor DownloadFile https://github.com/slevomat/PHP-Parallel-Lint/commit/50e939edf81619be100186f9c6192d97decad173.diff -FileName php-parallel-lint.patch
- git apply --directory vendor/jakub-onderka/php-parallel-lint -p1 --unsafe-paths --verbose php-parallel-lint.patch
- ps: Remove-Item -Path php-parallel-lint.patch
test_script:
- ps: cd $Env:project_directory
- vendor\bin\phing