|
| 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 |
0 commit comments