-
Notifications
You must be signed in to change notification settings - Fork 360
/
.appveyor.yml
134 lines (105 loc) · 4.96 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# This tests against the supported versions of Phan 4.x.y (PHP 7.2-8.0)
# The project name is the same as the build id used, e.g. https://www.appveyor.com/docs/environment-variables/
version: '{branch}.{build}'
clone_folder: C:\projects\phan
# Don't include full git history
clone_depth: 1
# Test 64-bit builds, which are far more commonly used.
# This also avoids errors seen when running PhanNativePHPSyntaxCheckPlugin in x86.
# https://github.com/php/php-src/issues/9650#issuecomment-1273961567
platform: x64
# Test with a given PHP version
# 1. (PHP_VERSION is the only version tested of PHP_EXT_VERSION, and it can only be built with VC_VERSION)
# 2. Also, run tests with a variety of supported php-ast versions. Phan should work properly with php-ast 1.0.1+
# See https://www.appveyor.com/docs/build-environment/#using-multiple-images-for-the-same-build for APPVEYOR_BUILD_WORKER_IMAGE details
environment:
matrix:
# This major release of Phan (5.0) requires php-ast 1.0.7+
# Note: Less convenient to test in php 8.2, especially because the PECL team's machine for building the dlls published on pecl.php.net has been broken for months.
- PHP_EXT_VERSION: '8.0'
PHP_VERSION: '8.0.22'
PHP_AST_VERSION: 1.0.13
VC: vs16
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PHAN_RUN_INTEGRATION_TEST: 1
- PHP_EXT_VERSION: '8.1'
PHP_VERSION: '8.1.10'
PHP_AST_VERSION: 1.0.16
VC: vs16
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# NOTE: 1.0.11 is the minimum php-ast version needed for ast version 85.
# https://pecl.php.net/package/ast/1.0.11/windows does not supply dlls for 7.2
# because pecl.php.net dropped support for building dlls for php 7.2, which no longer has security support.
#
# Read https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2 and https://wiki.php.net/internals/windows/stepbystepbuild_sdk_2#building_pecl_extensions
# or refer to appveyor.yml in php-ast for how to build your own dlls for php 7.2
# - PHP_EXT_VERSION: '7.2'
# PHP_VERSION: '7.2.33'
# VC: vc15
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# PHP_AST_VERSION: 1.0.11
- PHP_EXT_VERSION: '7.3'
PHP_VERSION: '7.3.32'
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PHP_AST_VERSION: 1.0.11
- PHP_EXT_VERSION: '7.4'
PHP_VERSION: '7.4.30'
VC_VERSION: 15
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PHP_AST_VERSION: 1.0.11
PHAN_RUN_INTEGRATION_TEST: 1
init:
- SET PATH=c:\projects\php;C:\projects\composer;%PATH%
# There are more than one version of php and php-ast that could be installed,
# so I'm not sure how to cache those.
cache:
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
- 'C:\projects\composer\composer.phar'
branches:
only:
- master
- v4
- v5
install:
- cmd: choco feature enable -n=allowGlobalConfirmation
- cmd: mkdir %APPVEYOR_BUILD_FOLDER%\bin
build_script:
- cmd: >-
mkdir C:\projects\php
cd C:\projects\php
SET PHP_ZIP_BASENAME=php-%PHP_VERSION%-nts-Win32-%VC%-x64.zip
curl -fsS https://windows.php.net/downloads/releases/archives/%PHP_ZIP_BASENAME% -o %PHP_ZIP_BASENAME% || curl -fsS https://windows.php.net/downloads/releases/%PHP_ZIP_BASENAME% -o %PHP_ZIP_BASENAME%
7z x -y %PHP_ZIP_BASENAME%
del /Q *.zip
cd C:\projects\php\ext
SET AST_ZIP_BASENAME=php_ast-%PHP_AST_VERSION%-%PHP_EXT_VERSION%-nts-%VC%-x64.zip
curl -fsS https://windows.php.net/downloads/pecl/releases/ast/%PHP_AST_VERSION%/%AST_ZIP_BASENAME% -o %AST_ZIP_BASENAME%
7z x %AST_ZIP_BASENAME% php_ast.dll -y >nul
cd C:\projects\php
echo [PHP] > php.ini
echo extension_dir = "ext" >> php.ini
echo extension=php_ast.dll >> php.ini
echo extension=php_curl.dll >> php.ini
echo extension=php_intl.dll >> php.ini
echo extension=php_mbstring.dll >> php.ini
echo extension=php_openssl.dll >> php.ini
echo extension=php_soap.dll >> php.ini
echo %PATH%
php -v
php -m
IF NOT exist "C:\projects\composer\composer.phar" ( curl --create-dirs -fsS https://getcomposer.org/composer.phar -o "C:\projects\composer\composer.phar" )
test_script:
- cmd: cd C:\projects\phan\internal\paratest
- cmd: php C:\projects\composer\composer.phar install --classmap-authoritative --prefer-dist --ignore-platform-reqs
- cmd: cd C:\projects\phan
- cmd: php C:\projects\composer\composer.phar install --classmap-authoritative --prefer-dist
- cmd: php phan --plugin InvokePHPNativeSyntaxCheckPlugin
# Run phpunit tests in parallel on all available processors (2 on appveyor).
# If running this step with Wine or symlinks, then use paratest --phpunit vendor/phpunit/phpunit/phpunit --verbose instead.
- cmd: .\internal\paratest\vendor\bin\paratest.bat --processes 2 --phpunit .\vendor\phpunit\phpunit\phpunit
# Verify that a phar can be built and executed under windows
- cmd: mkdir build
- cmd: php -d phar.readonly=0 internal/package.php
- cmd: php build/phan.phar --quick