forked from longxinH/xhprof
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
207 lines (197 loc) · 7.94 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
image: Visual Studio 2015
version: '{branch}.{build}'
cache:
- c:\build-cache -> .appveyor.yml
clone_folder: c:\projects\xhprof
install:
ps: |
if (-not (Test-Path c:\build-cache)) {
echo "Creating c:\build-cache"
mkdir c:\build-cache
}
$zip = 'php-sdk-' + $env:BIN_SDK_VER + '.zip'
if (-not (Test-Path c:\build-cache\sdk)) {
echo "Download https://github.com/microsoft/php-sdk-binary-tools/archive/$zip"
Invoke-WebRequest "https://github.com/microsoft/php-sdk-binary-tools/archive/$zip" -OutFile "c:\build-cache\$zip"
}
$source_folder = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
$target_folder = 'php-sdk-' + $env:BIN_SDK_VER
if (-not (Test-Path c:\build-cache\$target_folder)) {
7z x c:\build-cache\$zip -oc:\build-cache
move c:\build-cache\$source_folder c:\build-cache\$target_folder
}
environment:
BIN_SDK_VER: 2.2.0
matrix:
- PHP_VER: 7.4.0
ARCH: x64
TS: 1
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.4.0
ARCH: x64
TS: 0
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.4.0
ARCH: x86
TS: 1
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.4.0
ARCH: x86
TS: 0
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.3.13
ARCH: x64
TS: 1
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.3.13
ARCH: x64
TS: 0
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.3.13
ARCH: x86
TS: 1
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.3.13
ARCH: x86
TS: 0
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.2.26
ARCH: x64
TS: 1
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.2.26
ARCH: x64
TS: 0
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.2.26
ARCH: x86
TS: 1
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.2.26
ARCH: x86
TS: 0
VC: vc15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- PHP_VER: 7.1.33
ARCH: x64
TS: 1
VC: vc14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- PHP_VER: 7.1.33
ARCH: x64
TS: 0
VC: vc14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- PHP_VER: 7.1.33
ARCH: x86
TS: 1
VC: vc14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- PHP_VER: 7.1.33
ARCH: x86
TS: 0
VC: vc14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
build_script:
ps: |
$ts_part = ''
if ('0' -eq $env:TS) { $ts_part = '-nts' }
$zip = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
if (-not (Test-Path c:\build-cache\$zip)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$zip" -OutFile "c:\build-cache\$zip"
if (-not (Test-Path c:\build-cache\$zip)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/$zip" -OutFile "c:\build-cache\$zip"
}
}
$source_folder = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
$target_folder = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
if (-not (Test-Path c:\build-cache\$target_folder)) {
7z x c:\build-cache\$zip -oc:\build-cache
if ($source_folder -ne $target_folder) {
move c:\build-cache\$source_folder c:\build-cache\$target_folder
}
}
cd c:\projects\xhprof\extension
$env:PATH = 'c:\build-cache\' + $target_folder + ';' + $env:PATH
echo "" | Out-File -Encoding "ASCII" task.bat
echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
echo "call configure --enable-xhprof --enable-debug-pack 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
$here = (Get-Item -Path "." -Verbose).FullName
$runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
$task = $here + '\task.bat'
& $runner -t $task
after_build:
ps: |
$ts_part = ''
if ('0' -eq $env:TS) { $ts_part = '-nts' }
$arch_part = ''
if ('x64' -eq $env:ARCH) { $arch_part = '-x86_64' }
if ($env:APPVEYOR_REPO_TAG -eq "true") {
$bname = 'php_xhprof-' + $env:APPVEYOR_REPO_TAG_NAME + '-' + $env:PHP_VER.substring(0, 3) + '-' + $env:VC + $ts_part + $arch_part
} else {
#$bname = 'php_xhprof-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $env:VC + $ts_part + $arch_part
$bname = 'php_xhprof-' + $env:PHP_VER.substring(0, 3) + '-' + $env:VC + $ts_part + $arch_part
}
$zip_bname = $bname + '.zip'
$dll_bname = $bname + '.dll'
$dir = 'c:\projects\xhprof\extension\';
if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
$dir = $dir + 'Release'
if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
cp $dir\php_xhprof.dll $dir\$dll_bname
& 7z a c:\$zip_bname $dir\$dll_bname $dir\php_xhprof.pdb c:\projects\xhprof\LICENSE c:\projects\xhprof\xhprof_html\ c:\projects\xhprof\xhprof_lib\ c:\projects\xhprof\examples\ c:\projects\xhprof\README.md
Push-AppveyorArtifact c:\$zip_bname
test_script:
ps: |
$ts_part = ''
if ('0' -eq $env:TS) { $ts_part = '-nts' }
$bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
if (-not (Test-Path c:\build-cache\$bname)) {
Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
}
}
$dname = 'php-' + $env:PHP_VER + $ts_part + '-' + $env:VC.toUpper() + '-' + $env:ARCH
if (-not (Test-Path c:\build-cache\$dname)) {
7z x c:\build-cache\$bname -oc:\build-cache\$dname
}
$dir = 'c:\projects\xhprof\extension\';
if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
$dir = $dir + 'Release'
if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
$xhprof_dll_opt = '-d extension=' + $dir + '\php_xhprof.dll'
cd c:\projects\xhprof\extension\
mkdir c:\tests_tmp
echo "" | Out-File -Encoding "ASCII" task.bat
echo "set REPORT_EXIT_STATUS=1" | Out-File -Encoding "ASCII" -Append task.bat
$cmd = 'call configure --enable-xhprof --with-prefix=c:\build-cache\' + $dname + " 2>&1"
echo $cmd | Out-File -Encoding "ASCII" -Append task.bat
$opts = 'set TEST_PHP_ARGS=-n -d foo=yes'
$opts = $opts + ' -d extension=c:\build-cache\' + $dname + '\ext\php_curl.dll'
if ('yes' -eq $env:OPCACHE) { $opts = $opts + ' -d zend_extension=c:\build-cache\' + $dname + '\ext\php_opcache.dll -d opcache.enabled=1 -d opcache.enable_cli=1' }
$opts = $opts + ' ' + $xhprof_dll_opt
echo $opts | Out-File -Encoding "ASCII" -Append task.bat
$php = "c:\\build-cache\\" + $dname + '\php.exe'
$test_php_exec = "set TEST_PHP_EXECUTABLE=" + $php
echo $test_php_exec | Out-File -Encoding "ASCII" -Append task.bat
$tcmd = $php + ' run-tests.php -q --offline --show-diff --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp'
echo $tcmd | Out-File -Encoding "ASCII" -Append task.bat
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
$here = (Get-Item -Path "." -Verbose).FullName
$runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
$task = $here + '\task.bat'
& $runner -t $task