Skip to content

Commit 8cea434

Browse files
committed
enable appveyor
1 parent 6242374 commit 8cea434

File tree

2 files changed

+199
-1
lines changed

2 files changed

+199
-1
lines changed

.appveyor.yml

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
image: Visual Studio 2015
2+
version: '{branch}.{build}'
3+
4+
clone_folder: c:\projects\yar
5+
6+
install:
7+
ps: |
8+
if (-not (Test-Path c:\build-cache)) {
9+
mkdir c:\build-cache
10+
}
11+
$bname = 'php-sdk-' + $env:BIN_SDK_VER + '.zip'
12+
if (-not (Test-Path c:\build-cache\$bname)) {
13+
Invoke-WebRequest "https://github.com/microsoft/php-sdk-binary-tools/archive/$bname" -OutFile "c:\build-cache\$bname"
14+
}
15+
$dname0 = 'php-sdk-binary-tools-php-sdk-' + $env:BIN_SDK_VER
16+
$dname1 = 'php-sdk-' + $env:BIN_SDK_VER
17+
if (-not (Test-Path c:\build-cache\$dname1)) {
18+
7z x c:\build-cache\$bname -oc:\build-cache
19+
move c:\build-cache\$dname0 c:\build-cache\$dname1
20+
}
21+
$bname = 'libcurl-7.68.0-' + $env:VC + '-' + $env:ARCH + '.zip'
22+
$dname = 'libcurl-7.68.0-' + $env:VC + '-' + $env:ARCH
23+
if (-not (Test-Path c:\build-cache\$bname)) {
24+
$lname = 'https://windows.php.net/downloads/php-sdk/deps/' + $env:VC + '/' + $env:ARCH + "/$bname"
25+
Invoke-WebRequest "$lname" -OutFile "c:\build-cache\$bname"
26+
}
27+
28+
cache:
29+
- c:\build-cache -> .appveyor.yml
30+
31+
environment:
32+
BIN_SDK_VER: 2.2.0
33+
matrix:
34+
- PHP_VER: 7.4.0
35+
ARCH: x64
36+
TS: 1
37+
VC: vc15
38+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
39+
- PHP_VER: 7.4.0
40+
ARCH: x64
41+
TS: 0
42+
VC: vc15
43+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
44+
- PHP_VER: 7.4.0
45+
ARCH: x86
46+
TS: 1
47+
VC: vc15
48+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
49+
- PHP_VER: 7.4.0
50+
ARCH: x86
51+
TS: 0
52+
VC: vc15
53+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
54+
- PHP_VER: 7.3.13
55+
ARCH: x64
56+
TS: 1
57+
VC: vc15
58+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
59+
- PHP_VER: 7.3.13
60+
ARCH: x64
61+
TS: 0
62+
VC: vc15
63+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
64+
- PHP_VER: 7.2.26
65+
ARCH: x64
66+
TS: 1
67+
VC: vc15
68+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
69+
- PHP_VER: 7.2.26
70+
ARCH: x64
71+
TS: 0
72+
VC: vc15
73+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
74+
- PHP_VER: 7.1.33
75+
ARCH: x64
76+
TS: 1
77+
VC: vc14
78+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
79+
- PHP_VER: 7.1.33
80+
ARCH: x64
81+
TS: 0
82+
VC: vc14
83+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
84+
85+
build_script:
86+
ps: |
87+
$ts_part = ''
88+
if ('0' -eq $env:TS) { $ts_part = '-nts' }
89+
$bname = 'php-devel-pack-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
90+
if (-not (Test-Path c:\build-cache\$bname)) {
91+
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
92+
if (-not (Test-Path c:\build-cache\$bname)) {
93+
Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
94+
}
95+
}
96+
$dname0 = 'php-' + $env:PHP_VER + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
97+
$dname1 = 'php-' + $env:PHP_VER + $ts_part + '-devel-' + $env:VC.toUpper() + '-' + $env:ARCH
98+
if (-not (Test-Path c:\build-cache\$dname1)) {
99+
7z x c:\build-cache\$bname -oc:\build-cache
100+
if ($dname0 -ne $dname1) {
101+
move c:\build-cache\$dname0 c:\build-cache\$dname1
102+
}
103+
}
104+
$env:PATH = 'c:\build-cache\' + $dname1 + ';' + $env:PATH
105+
106+
$bname = 'libcurl-7.68.0-' + $env:VC + '-' + $env:ARCH + '.zip'
107+
$dname = 'libcurl-7.68.0-' + $env:VC + '-' + $env:ARCH
108+
if (-not (Test-Path c:\projects\yar\libcurl_a.lib)) {
109+
7z x c:\build-cache\$bname -oc:\build-cache\$dname
110+
move c:\build-cache\$dname\include c:\projects\yar\
111+
move c:\build-cache\$dname\lib\ c:\projects\yar\
112+
move c:\build-cache\$dname\bin c:\projects\yar\
113+
rm -oc:\build-cache\$dname
114+
}
115+
cd c:\projects\yar
116+
$env:PATH = 'c:\projects\yar\;' + $env:PATH
117+
#echo "@echo off" | Out-File -Encoding "ASCII" task.bat
118+
#echo "" | Out-File -Encoding "ASCII" -Append task.bat
119+
echo "" | Out-File -Encoding "ASCII" task.bat
120+
echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
121+
echo "call configure --enable-yar --enable-debug-pack 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
122+
echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append task.bat
123+
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
124+
$here = (Get-Item -Path "." -Verbose).FullName
125+
$runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
126+
$task = $here + '\task.bat'
127+
& $runner -t $task
128+
129+
after_build:
130+
ps: |
131+
$ts_part = ''
132+
if ('0' -eq $env:TS) { $ts_part = '-nts' }
133+
$arch_part = ''
134+
if ('x64' -eq $env:ARCH) { $arch_part = '-x86_64' }
135+
if ($env:APPVEYOR_REPO_TAG -eq "true") {
136+
$bname = 'php_yar-' + $env:APPVEYOR_REPO_TAG_NAME + '-' + $env:PHP_VER.substring(0, 3) + '-' + $env:VC + $ts_part + $arch_part
137+
} else {
138+
$bname = 'php_yar-' + $env:APPVEYOR_REPO_COMMIT.substring(0, 8) + '-' + $env:PHP_VER.substring(0, 3) + '-' + $env:VC + $ts_part + $arch_part
139+
}
140+
$zip_bname = $bname + '.zip'
141+
$dll_bname = $bname + '.dll'
142+
143+
$dir = 'c:\projects\yar\';
144+
if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
145+
$dir = $dir + 'Release'
146+
if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
147+
148+
cp $dir\php_yar.dll $dir\$dll_bname
149+
& 7z a c:\$zip_bname $dir\$dll_bname $dir\php_yar.pdb c:\projects\yar\LICENSE
150+
Push-AppveyorArtifact c:\$zip_bname
151+
152+
test_script:
153+
ps: |
154+
$ts_part = ''
155+
if ('0' -eq $env:TS) { $ts_part = '-nts' }
156+
$bname = 'php-' + $env:PHP_VER + $ts_part + '-Win32-' + $env:VC.toUpper() + '-' + $env:ARCH + '.zip'
157+
if (-not (Test-Path c:\build-cache\$bname)) {
158+
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$bname" -OutFile "c:\build-cache\$bname"
159+
if (-not (Test-Path c:\build-cache\$bname)) {
160+
Invoke-WebRequest "http://windows.php.net/downloads/releases/$bname" -OutFile "c:\build-cache\$bname"
161+
}
162+
}
163+
$dname = 'php-' + $env:PHP_VER + $ts_part + '-' + $env:VC.toUpper() + '-' + $env:ARCH
164+
if (-not (Test-Path c:\build-cache\$dname)) {
165+
7z x c:\build-cache\$bname -oc:\build-cache\$dname
166+
}
167+
168+
$dir = 'c:\projects\yar\';
169+
if ('x64' -eq $env:ARCH) { $dir = $dir + 'x64\' }
170+
$dir = $dir + 'Release'
171+
if ('1' -eq $env:TS) { $dir = $dir + '_TS' }
172+
173+
$yar_dll_opt = '-d extension=' + $dir + '\php_yar.dll'
174+
175+
176+
cd c:\projects\yar
177+
mkdir c:\tests_tmp
178+
echo "" | Out-File -Encoding "ASCII" task.bat
179+
echo "set REPORT_EXIT_STATUS=1" | Out-File -Encoding "ASCII" -Append task.bat
180+
$cmd = 'call configure --enable-yar --with-prefix=c:\build-cache\' + $dname + " 2>&1"
181+
echo $cmd | Out-File -Encoding "ASCII" -Append task.bat
182+
183+
$opts = 'set TEST_PHP_ARGS=-n -d foo=yes'
184+
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' }
185+
$opts = $opts + ' ' + $yar_dll_opt
186+
echo $opts | Out-File -Encoding "ASCII" -Append task.bat
187+
188+
$php = "c:\\build-cache\\" + $dname + '\php.exe'
189+
$test_php_exec = "set TEST_PHP_EXECUTABLE=" + $php
190+
echo $test_php_exec | Out-File -Encoding "ASCII" -Append task.bat
191+
$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 -p c:\build-cache\' + $dname + '\php.exe'
192+
echo $tcmd | Out-File -Encoding "ASCII" -Append task.bat
193+
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append task.bat
194+
195+
$here = (Get-Item -Path "." -Verbose).FullName
196+
$runner = 'c:\build-cache\php-sdk-' + $env:BIN_SDK_VER + '\phpsdk' + '-' + $env:VC + '-' + $env:ARCH + '.bat'
197+
$task = $here + '\task.bat'
198+
& $runner -t $task

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Yar - Yet Another RPC framework for PHP
2-
[![Build Status](https://secure.travis-ci.org/laruence/yar.png)](http://travis-ci.org/laruence/yar)
2+
[![Build Status](https://secure.travis-ci.org/laruence/yar.png)](http://travis-ci.org/laruence/yar) [![Build status](https://ci.appveyor.com/api/projects/status/syhw33wlt2nad64i/branch/master?svg=true)](https://ci.appveyor.com/project/laruence/yar/branch/master)
33

44
Light, concurrent RPC framework for PHP(see also: [Yar C framework](https://github.com/laruence/yar-c), [Yar Java framework](https://github.com/weibocom/yar-java))
55

0 commit comments

Comments
 (0)