Skip to content

Commit 881866c

Browse files
committed
Added appveyor configuration and config.w32
1 parent 1cf7231 commit 881866c

File tree

6 files changed

+209
-0
lines changed

6 files changed

+209
-0
lines changed

.appveyor.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: '{branch}.{build}'
2+
3+
image: Visual Studio 2015
4+
5+
environment:
6+
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
7+
PHP_BUILD_OBJ_DIR: c:\obj
8+
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
9+
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.1
10+
SDK_REMOTE: https://github.com/OSTC/php-sdk-binary-tools.git
11+
SDK_BRANCH: php-sdk-2.1.1
12+
13+
matrix:
14+
- PHP_REL: 7.2
15+
ARCHITECTURE: x64
16+
ZTS_STATE: enable
17+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
18+
PHP_BUILD_CRT: vc15
19+
- PHP_REL: 7.2
20+
ARCHITECTURE: x64
21+
ZTS_STATE: disable
22+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
23+
PHP_BUILD_CRT: vc15
24+
- PHP_REL: 7.2
25+
ARCHITECTURE: x86
26+
ZTS_STATE: enable
27+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
28+
PHP_BUILD_CRT: vc15
29+
- PHP_REL: 7.2
30+
ARCHITECTURE: x86
31+
ZTS_STATE: disable
32+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
33+
PHP_BUILD_CRT: vc15
34+
- PHP_REL: 7.1
35+
ARCHITECTURE: x64
36+
ZTS_STATE: enable
37+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
38+
PHP_BUILD_CRT: vc14
39+
- PHP_REL: 7.1
40+
ARCHITECTURE: x86
41+
ZTS_STATE: disable
42+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
43+
PHP_BUILD_CRT: vc14
44+
- PHP_REL: 7.0
45+
ARCHITECTURE: x64
46+
ZTS_STATE: disable
47+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
48+
PHP_BUILD_CRT: vc14
49+
- PHP_REL: 7.0
50+
ARCHITECTURE: x86
51+
ZTS_STATE: enable
52+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
53+
PHP_BUILD_CRT: vc14
54+
55+
install:
56+
- .appveyor\install.cmd
57+
58+
build_script:
59+
- .appveyor\build.cmd
60+

.appveyor/build.cmd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@echo off
2+
3+
setlocal enableextensions enabledelayedexpansion
4+
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%ARCHITECTURE%.bat
5+
if not exist "!SDK_RUNNER!" (
6+
echo "!SDK_RUNNER!" doesn't exist
7+
exit /b 3
8+
)
9+
10+
cmd /c !SDK_RUNNER! -t %APPVEYOR_BUILD_FOLDER%\.appveyor\build_task.cmd
11+
12+
if %errorlevel% neq 0 exit /b 3
13+
endlocal
14+
15+
exit /b 0

.appveyor/build_task.cmd

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@echo off
2+
setlocal enableextensions enabledelayedexpansion
3+
4+
cd /D %APPVEYOR_BUILD_FOLDER%
5+
if %errorlevel% neq 0 exit /b 3
6+
7+
set STABILITY=staging
8+
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_REL%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
9+
rem SDK is cached, deps info is cached as well
10+
echo Updating dependencies in %DEPS_DIR%
11+
cmd /c phpsdk_deps --update --no-backup --branch %PHP_REL% --stability %STABILITY% --deps %DEPS_DIR%
12+
if %errorlevel% neq 0 exit /b 3
13+
14+
rem Something went wrong, most likely when concurrent builds were to fetch deps
15+
rem updates. It might be, that some locking mechanism is needed.
16+
if not exist "%DEPS_DIR%" (
17+
cmd /c phpsdk_deps --update --force --no-backup --branch %PHP_REL% --stability %STABILITY% --deps %DEPS_DIR%
18+
)
19+
if %errorlevel% neq 0 exit /b 3
20+
21+
if "%ZTS_STATE%"=="enable" set ZTS_SHORT=ts
22+
if "%ZTS_STATE%"=="disable" set ZTS_SHORT=nts
23+
if "%ZTS_STATE%"=="enable" set ZTS_IN_FILENAME=
24+
if "%ZTS_STATE%"=="disable" set ZTS_IN_FILENAME=-nts
25+
if "%PHP_SDK_ARCH%"=="x86" set ARCH_IN_FILENAME=
26+
if "%PHP_SDK_ARCH%"=="x64" set ARCH_IN_FILENAME=-x86_64
27+
28+
cd /d C:\projects\php-src
29+
30+
cmd /c buildconf.bat --force
31+
32+
if %errorlevel% neq 0 exit /b 3
33+
34+
cmd /c configure.bat --disable-all --with-mp=auto --enable-cli --%ZTS_STATE%-zts --enable-clusterize=shared --enable-object-out-dir=%PHP_BUILD_OBJ_DIR% --with-config-file-scan-dir=%APPVEYOR_BUILD_FOLDER%\build\modules.d --with-prefix=%APPVEYOR_BUILD_FOLDER%\build --with-php-build=%DEPS_DIR%
35+
36+
if %errorlevel% neq 0 exit /b 3
37+
38+
nmake /NOLOGO
39+
if %errorlevel% neq 0 exit /b 3
40+
41+
nmake install
42+
43+
if %errorlevel% neq 0 exit /b 3
44+
45+
mkdir c:\tests_tmp
46+
set TEST_PHP_EXECUTABLE=%APPVEYOR_BUILD_FOLDER%\build\php.exe
47+
set TEST_PHP_JUNIT=c:\tests_tmp\tests-junit.xml
48+
if "%OPCACHE%" equ "1" set TEST_PHP_ARGS=!TEST_PHP_ARGS! -d extension=%APPVEYOR_BUILD_FOLDER%\build\ext\php_opcache.so -d opcache.enable=1 -d opcache.enable_cli=1
49+
set TEST_PHP_ARGS=-n -d -foo=1 -d extension=%APPVEYOR_BUILD_FOLDER%\build\ext\php_clusterize.dll -dxdebug.remote_enable=1
50+
set SKIP_SLOW_TESTS=1
51+
set SKIP_DBGP_TESTS=1
52+
set SKIP_IPV6_TESTS=1
53+
set REPORT_EXIT_STATUS=1
54+
echo !TEST_PHP_EXECUTABLE! !TEST_PHP_ARGS! -v
55+
echo !TEST_PHP_EXECUTABLE! -n run-tests.php -q -x --show-diff --show-slow 1000 --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp %APPVEYOR_BUILD_FOLDER%\tests
56+
!TEST_PHP_EXECUTABLE! !TEST_PHP_ARGS! -v
57+
!TEST_PHP_EXECUTABLE! -n run-tests.php -q -x --show-diff %APPVEYOR_BUILD_FOLDER%\tests
58+
59+
set EXIT_CODE=%errorlevel%
60+
powershell -Command "$wc = New-Object 'System.Net.WebClient'; $wc.UploadFile('https://ci.appveyor.com/api/testresults/junit/%APPVEYOR_JOB_ID%', 'c:\tests_tmp\tests-junit.xml')"
61+
62+
rem We have run the tests, but we're *not* making that fail the build — yet
63+
rem if %EXIT_CODE% neq 0 exit /b 3
64+
65+
cd /d %APPVEYOR_BUILD_FOLDER%
66+
67+
if not exist "%APPVEYOR_BUILD_FOLDER%\build\ext\php_clusterize.dll" exit /b 3
68+
69+
xcopy %APPVEYOR_BUILD_FOLDER%\LICENSE %APPVEYOR_BUILD_FOLDER%\php_clusterize-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\ /y /f
70+
echo F|xcopy %APPVEYOR_BUILD_FOLDER%\build\ext\php_clusterize.dll %APPVEYOR_BUILD_FOLDER%\php_clusterize-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\php_clusterize-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.dll /y /f
71+
7z a php_clusterize-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip %APPVEYOR_BUILD_FOLDER%\php_clusterize-%PHP_REL%-!ZTS_SHORT!-%PHP_BUILD_CRT%-%PHP_SDK_ARCH%\*
72+
appveyor PushArtifact php_clusterize-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip -FileName php_clusterize-%APPVEYOR_REPO_TAG_NAME%-%PHP_REL%-%PHP_BUILD_CRT%!ZTS_IN_FILENAME!!ARCH_IN_FILENAME!.zip
73+
endlocal

.appveyor/install.cmd

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
@echo off
2+
setlocal enableextensions enabledelayedexpansion
3+
cinst wget
4+
5+
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
6+
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
7+
mkdir "%PHP_BUILD_CACHE_BASE_DIR%"
8+
)
9+
10+
if not exist "%PHP_BUILD_OBJ_DIR%" (
11+
echo Creating %PHP_BUILD_OBJ_DIR%
12+
mkdir "%PHP_BUILD_OBJ_DIR%"
13+
)
14+
15+
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
16+
echo Cloning remote SDK repository
17+
git clone -q --depth=1 --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%"
18+
) else (
19+
echo Fetching remote SDK repository
20+
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
21+
echo Checkout SDK repository branch
22+
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
23+
)
24+
25+
if "%PHP_REL%"=="master" (
26+
echo Cloning PHP master repository
27+
git clone -q --depth=1 --branch=%PHP_REL% https://github.com/php/php-src C:\projects\php-src
28+
) else (
29+
echo Cloning PHP %PHP_REL% repository
30+
git clone -q --depth=1 --branch=PHP-%PHP_REL% https://github.com/php/php-src C:\projects\php-src
31+
)
32+
33+
echo "Runnning sub-module fetch"
34+
git submodule update --init --recursive
35+
36+
xcopy %APPVEYOR_BUILD_FOLDER% C:\projects\php-src\ext\clusterize\ /s /e /y /q
37+
38+
xcopy %APPVEYOR_BUILD_FOLDER%\LICENSE %APPVEYOR_BUILD_FOLDER%\artifacts\ /y /f /q
39+
40+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
41+
if %errorlevel% neq 0 exit /b 3
42+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
43+
if %errorlevel% neq 0 exit /b 3
44+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
45+
if %errorlevel% neq 0 exit /b 3
46+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
47+
if %errorlevel% neq 0 exit /b 3
48+
49+
if "%APPVEYOR_REPO_TAG_NAME%"=="" (
50+
set APPVEYOR_REPO_TAG_NAME=%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT:~0,8%
51+
echo Final repo tag name: !APPVEYOR_REPO_TAG_NAME!
52+
53+
appveyor SetVariable -Name APPVEYOR_REPO_TAG_NAME -Value !APPVEYOR_REPO_TAG_NAME!
54+
)
55+
endlocal

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![Build Status](https://travis-ci.org/iworker/clusterize.svg?branch=master)](https://travis-ci.org/iworker/clusterize)
2+
[![Windows Build status](https://ci.appveyor.com/api/projects/status/db0k8h3f4n263nat?svg=true)](https://ci.appveyor.com/project/iworker/clusterize)
23

34
# clusterize
45
PHP extension for clustering points on GEO map

config.w32

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
ARG_ENABLE("clusterize", "enable clusterize extension", "no");
2+
3+
if (PHP_CLUSTERIZE != "no") {
4+
EXTENSION("clusterize", "clusterize.c kmeans.c points.c");
5+
}

0 commit comments

Comments
 (0)