@@ -4,11 +4,10 @@ set NO_INTERACTION=1
4
4
set REPORT_EXIT_STATUS = 1
5
5
set SKIP_IO_CAPTURE_TESTS = 1
6
6
7
- if /i " %APPVEYOR_REPO_BRANCH:~ 0 , 4 % " equ " php- " (
8
- set BRANCH = %APPVEYOR_REPO_BRANCH:~ 4 , 3 %
7
+ call %~dp0 find-target-branch.bat
8
+ if " % BRANCH% " neq " master " (
9
9
set STABILITY = stable
10
10
) else (
11
- set BRANCH = master
12
11
set STABILITY = staging
13
12
)
14
13
set DEPS_DIR = %PHP_BUILD_CACHE_BASE_DIR% \deps-%BRANCH% -%PHP_SDK_VS% -%PHP_SDK_ARCH%
@@ -28,7 +27,12 @@ set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
28
27
set PDO_MYSQL_TEST_HOST = %MYSQL_TEST_HOST%
29
28
set PDO_MYSQL_TEST_PORT = %MYSQL_TEST_PORT%
30
29
set PDO_MYSQL_TEST_DSN = mysql:host=%PDO_MYSQL_TEST_HOST% ;port=%PDO_MYSQL_TEST_PORT% ;dbname=test
31
- " C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e " CREATE DATABASE IF NOT EXISTS test"
30
+ if /i " %APPVEYOR% " equ " True" (
31
+ set TMP_MYSQL_BIN = %ProgramFiles% \MySql\MySQL Server 5.7\bin
32
+ ) else (
33
+ set TMP_MYSQL_BIN = C:\mysql\bin
34
+ )
35
+ " %TMP_MYSQL_BIN% \mysql.exe" --host=%PDO_MYSQL_TEST_HOST% --port=%MYSQL_TEST_PORT% --user=%MYSQL_TEST_USER% --password=%MYSQL_TEST_PASSWD% -e " CREATE DATABASE IF NOT EXISTS test"
32
36
if %errorlevel% neq 0 exit /b 3
33
37
34
38
rem setup PostgreSQL related exts
@@ -37,23 +41,35 @@ set PGPASSWORD=Password12!
37
41
rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!
38
42
echo ^ < ?php $conn_str = " host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD% " ; ?^ > >> " ./ext/pgsql/tests/config.inc"
39
43
set PDO_PGSQL_TEST_DSN = pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD%
40
- " C:\Program Files\PostgreSQL\10\bin\createdb.exe" test
44
+ if /i " %APPVEYOR% " equ " True" (
45
+ set TMP_POSTGRESQL_BIN = %ProgramFiles% \PostgreSQL\10\bin
46
+ ) else (
47
+ set TMP_POSTGRESQL_BIN = %PGBIN%
48
+ )
49
+ " %TMP_POSTGRESQL_BIN% \createdb.exe" test
41
50
if %errorlevel% neq 0 exit /b 3
42
51
43
52
rem setup ODBC related exts
44
53
set ODBC_TEST_USER = sa
45
54
set ODBC_TEST_PASS = Password12!
46
- set ODBC_TEST_DSN = Driver={ODBC Driver 13 for SQL Server};Server=(local)\SQL2017;Database=master;uid=%ODBC_TEST_USER% ;pwd=%ODBC_TEST_PASS%
55
+ if /i " %APPVEYOR% " equ " True" (
56
+ set ODBC_TEST_DSN = Driver={ODBC Driver 13 for SQL Server};Server=^ (local^ )\SQL2017;Database=master;uid=%ODBC_TEST_USER% ;pwd=%ODBC_TEST_PASS%
57
+ ) else (
58
+ set ODBC_TEST_DSN = Driver={ODBC Driver 17 for SQL Server};Server=^ (local^ )\SQLEXPRESS;Database=master;uid=%ODBC_TEST_USER% ;pwd=%ODBC_TEST_PASS%
59
+ )
47
60
set PDOTEST_DSN = odbc:%ODBC_TEST_DSN%
48
61
49
62
rem prepare for ext/openssl
50
- if " %APPVEYOR% " equ " True " rmdir /s /q C:\OpenSSL-Win32 > NUL 2 > NUL
51
- if " %APPVEYOR% " equ " True " rmdir /s /q C:\OpenSSL-Win64 > NUL 2 > NUL
63
+ rmdir /s /q C:\OpenSSL-Win32 > NUL 2 > NUL
64
+ rmdir /s /q C:\OpenSSL-Win64 > NUL 2 > NUL
52
65
if " %PLATFORM% " == " x64" (
53
66
set OPENSSLDIR = " C:\Program Files\Common Files\SSL"
54
67
) else (
55
68
set OPENSSLDIR = " C:\Program Files (x86)\Common Files\SSL"
56
69
)
70
+ if /i " %GITHUB_ACTIONS% " equ " True" (
71
+ rmdir /s /q %OPENSSLDIR% > nul 2 >& 1
72
+ )
57
73
mkdir %OPENSSLDIR%
58
74
if %errorlevel% neq 0 exit /b 3
59
75
copy %DEPS_DIR% \template\ssl\openssl.cnf %OPENSSLDIR%
@@ -68,28 +84,18 @@ rem work-around for failing to dl(mysqli) with OPcache (https://github.com/php/p
68
84
if " %OPCACHE% " equ " 1" set OPCACHE_OPTS = %OPCACHE_OPTS% -d extension=mysqli
69
85
70
86
rem prepare for enchant
71
- mkdir C: \usr\local\lib\enchant-2
87
+ mkdir %~d0 \usr\local\lib\enchant-2
72
88
if %errorlevel% neq 0 exit /b 3
73
- copy %DEPS_DIR% \bin\libenchant2_hunspell.dll C: \usr\local\lib\enchant-2
89
+ copy %DEPS_DIR% \bin\libenchant2_hunspell.dll %~d0 \usr\local\lib\enchant-2
74
90
if %errorlevel% neq 0 exit /b 3
75
- reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins
91
+ mkdir %~d0 \usr\local\share\enchant\hunspell
76
92
if %errorlevel% neq 0 exit /b 3
77
- set PHP_BUILD_CACHE_ENCHANT_DICT_DIR = %PHP_BUILD_CACHE_BASE_DIR% \enchant_dict
78
- if not exist " %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% " (
79
- echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%
80
- mkdir " %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% "
81
- )
82
- if not exist " %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% \en_US.aff" (
83
- echo Fetching enchant dicts
84
- pushd %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%
85
- del /q *
86
- powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip
87
- unzip dict.zip
88
- del /q dict.zip
89
- popd
90
- )
91
- mkdir %LOCALAPPDATA% \enchant\hunspell
92
- copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR% \* %LOCALAPPDATA% \enchant\hunspell
93
+ echo Fetching enchant dicts
94
+ pushd %~d0 \usr\local\share\enchant\hunspell
95
+ powershell -Command wget http://windows.php.net/downloads/qa/appveyor/ext/enchant/dict.zip -OutFile dict.zip
96
+ unzip dict.zip
97
+ del /q dict.zip
98
+ popd
93
99
94
100
set PHP_BUILD_DIR = %PHP_BUILD_OBJ_DIR% \Release
95
101
if " %THREAD_SAFE% " equ " 1" set PHP_BUILD_DIR = %PHP_BUILD_DIR% _TS
@@ -113,17 +119,20 @@ mkdir c:\tests_tmp
113
119
114
120
set TEST_PHP_JUNIT = c:\junit.out.xml
115
121
116
- cd " %APPVEYOR_BUILD_FOLDER% "
117
122
nmake test TESTS=" %OPCACHE_OPTS% -q --offline --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp --bless %PARALLEL% "
118
123
119
124
set EXIT_CODE = %errorlevel%
120
125
121
- appveyor PushArtifact %TEST_PHP_JUNIT%
122
-
123
126
if %EXIT_CODE% GEQ 1 (
124
127
git checkout ext\pgsql\tests\config.inc
125
128
git diff > bless_tests.patch
126
- appveyor PushArtifact bless_tests.patch
129
+ )
130
+
131
+ if /i " %APPVEYOR% " equ " True" (
132
+ appveyor PushArtifact %TEST_PHP_JUNIT%
133
+ if %EXIT_CODE% GEQ 1 (
134
+ appveyor PushArtifact bless_tests.patch
135
+ )
127
136
)
128
137
129
138
exit /b %EXIT_CODE%
0 commit comments