Skip to content

Commit b90135b

Browse files
committed
Merge branch 'v1.8'
2 parents 1c4fbe2 + d37449a commit b90135b

14 files changed

+236
-241
lines changed

.appveyor.yml

Lines changed: 139 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,150 @@
1-
image: Visual Studio 2015
1+
image: Visual Studio 2017
22
version: '{branch}.{build}'
33

4+
clone_folder: c:\projects\mongodb
5+
46
cache:
5-
- c:\build-cache -> .appveyor.yml, .appveyor\*.cmd
7+
- c:\build-cache -> .appveyor.yml
8+
9+
platform:
10+
- x86
11+
- x64
612

713
environment:
8-
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
9-
PHP_BUILD_OBJ_DIR: c:\obj
10-
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
11-
PHP_BUILD_SDK_BRANCH: php-sdk-2.1.1
12-
SDK_REMOTE: https://github.com/OSTC/php-sdk-binary-tools.git
13-
SDK_BRANCH: php-sdk-2.1.1
14+
BIN_SDK_VER: 2.2.0
15+
CONFIGURE_OPTS: --enable-mongodb --with-mongodb-sasl=yes --with-mongodb-client-side-encryption=yes
1416

1517
matrix:
16-
- PHP_REL: 7.4
17-
ARCHITECTURE: x64
18-
ZTS_STATE: enable
19-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
20-
PHP_BUILD_CRT: vc15
21-
- PHP_REL: 7.4
22-
ARCHITECTURE: x64
23-
ZTS_STATE: disable
24-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
25-
PHP_BUILD_CRT: vc15
26-
- PHP_REL: 7.4
27-
ARCHITECTURE: x86
28-
ZTS_STATE: enable
29-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
30-
PHP_BUILD_CRT: vc15
31-
- PHP_REL: 7.4
32-
ARCHITECTURE: x86
33-
ZTS_STATE: disable
34-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
35-
PHP_BUILD_CRT: vc15
36-
- PHP_REL: 7.3
37-
ARCHITECTURE: x64
38-
ZTS_STATE: enable
39-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
40-
PHP_BUILD_CRT: vc15
41-
- PHP_REL: 7.3
42-
ARCHITECTURE: x64
43-
ZTS_STATE: disable
44-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
45-
PHP_BUILD_CRT: vc15
46-
- PHP_REL: 7.2
47-
ARCHITECTURE: x64
48-
ZTS_STATE: enable
49-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
50-
PHP_BUILD_CRT: vc15
51-
- PHP_REL: 7.2
52-
ARCHITECTURE: x64
53-
ZTS_STATE: disable
54-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
55-
PHP_BUILD_CRT: vc15
56-
- PHP_REL: 7.1
57-
ARCHITECTURE: x64
58-
ZTS_STATE: enable
59-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
60-
PHP_BUILD_CRT: vc14
61-
- PHP_REL: 7.1
62-
ARCHITECTURE: x64
63-
ZTS_STATE: disable
64-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
65-
PHP_BUILD_CRT: vc14
66-
- PHP_REL: 7.1
67-
ARCHITECTURE: x86
68-
ZTS_STATE: enable
69-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
70-
PHP_BUILD_CRT: vc14
71-
- PHP_REL: 7.1
72-
ARCHITECTURE: x86
73-
ZTS_STATE: disable
74-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
75-
PHP_BUILD_CRT: vc14
18+
- PHP_VER: 7.4.4
19+
TS: 1
20+
CRT: vc15
21+
- PHP_VER: 7.4.4
22+
TS: 0
23+
CRT: vc15
24+
- PHP_VER: 7.3.16
25+
TS: 1
26+
CRT: vc15
27+
- PHP_VER: 7.3.16
28+
TS: 0
29+
CRT: vc15
30+
- PHP_VER: 7.2.29
31+
TS: 1
32+
CRT: vc15
33+
- PHP_VER: 7.2.29
34+
TS: 0
35+
CRT: vc15
36+
37+
services:
38+
- mongodb
7639

7740
install:
78-
- .appveyor\install.cmd
41+
- cmd: git submodule update --init
42+
- ps: |
43+
if (-not (Test-Path c:\build-cache)) {
44+
mkdir c:\build-cache
45+
}
46+
47+
$sdk_dir = "c:\build-cache\php-sdk-$($env:BIN_SDK_VER)"
48+
49+
if (-not (Test-Path $sdk_dir)) {
50+
$sdk_pkg = "php-sdk-$($env:BIN_SDK_VER).zip"
51+
52+
if (-not (Test-Path c:\build-cache\$sdk_pkg)) {
53+
Invoke-WebRequest "https://github.com/microsoft/php-sdk-binary-tools/archive/$sdk_pkg" -OutFile "c:\build-cache\$sdk_pkg"
54+
}
55+
56+
& 7z x c:\build-cache\$sdk_pkg -oc:\build-cache
57+
58+
$sdk_pkg_dir = "c:\build-cache\php-sdk-binary-tools-php-sdk-$($env:BIN_SDK_VER)"
59+
Rename-Item -Path $sdk_pkg_dir -NewName $sdk_dir
60+
}
61+
62+
# TS part is omitted in archive path, so manually include it to avoid a build cache conflict
63+
$devel_dir = 'c:\build-cache\php-{0}-{1}-devel-{2}-{3}' -f $env:PHP_VER, ('nts','ts')[$env:TS], $env:CRT.toUpper(), $env:PLATFORM
64+
65+
if (-not (Test-Path $devel_dir)) {
66+
$devel_pkg = 'php-devel-pack-{0}{1}-Win32-{2}-{3}.zip' -f $env:PHP_VER, ('-nts','')[$env:TS], $env:CRT.toUpper(), $env:PLATFORM
67+
68+
if (-not (Test-Path c:\build-cache\$devel_pkg)) {
69+
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$devel_pkg" -OutFile "c:\build-cache\$devel_pkg"
70+
71+
# Latest versions will be in releases/ instead of releases/archives
72+
if (-not (Test-Path c:\build-cache\$devel_pkg)) {
73+
Invoke-WebRequest "http://windows.php.net/downloads/releases/$devel_pkg" -OutFile "c:\build-cache\$devel_pkg"
74+
}
75+
}
76+
77+
& 7z x c:\build-cache\$devel_pkg -oc:\build-cache
78+
79+
$devel_pkg_dir = 'c:\build-cache\php-{0}-devel-{1}-{2}' -f $env:PHP_VER, $env:CRT.toUpper(), $env:PLATFORM
80+
Rename-Item -Path $devel_pkg_dir -NewName $devel_dir
81+
}
82+
83+
$sdk_runner = '{0}\phpsdk-{1}-{2}.bat' -f $sdk_dir, $env:CRT, $env:PLATFORM
84+
85+
# Install shared library dependencies
86+
$php_branch = $env:PHP_VER.Substring(0, 3)
87+
$deps_dir = 'c:\build-cache\deps-{0}-{1}-{2}' -f $php_branch, $env:CRT.toUpper(), $env:PLATFORM
88+
89+
if (-not (Test-Path $deps_dir)) {
90+
echo "" | Out-File -Encoding "ASCII" install_deps.bat
91+
echo "cmd /C $sdk_dir\bin\phpsdk_deps.bat --update --force --no-backup --branch $php_branch --stability stable --deps $deps_dir" | Out-File -Encoding "ASCII" -Append install_deps.bat
92+
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append install_deps.bat
93+
94+
& $sdk_runner -t $env:APPVEYOR_BUILD_FOLDER\install_deps.bat
95+
}
96+
97+
$env:PATH = "$devel_dir;$env:PATH"
98+
$env:SDK_RUNNER = $sdk_runner
99+
$env:DEPS_DIR = $deps_dir
79100
80101
build_script:
81-
- .appveyor\build.cmd
102+
ps: |
103+
echo "" | Out-File -Encoding "ASCII" build.bat
104+
echo "call phpize 2>&1" | Out-File -Encoding "ASCII" -Append build.bat
105+
echo "call configure $env:CONFIGURE_OPTS --enable-debug-pack --with-php-build=$env:DEPS_DIR 2>&1" | Out-File -Encoding "ASCII" -Append build.bat
106+
echo "nmake /nologo 2>&1" | Out-File -Encoding "ASCII" -Append build.bat
107+
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append build.bat
108+
109+
& $env:SDK_RUNNER -t $env:APPVEYOR_BUILD_FOLDER\build.bat
110+
111+
after_build:
112+
ps: |
113+
$commit = $env:APPVEYOR_REPO_COMMIT.substring(0, 8)
114+
$php_branch = $env:PHP_VER.Substring(0, 3)
115+
116+
$zip = '{0}\php_mongodb-{1}-{2}-{3}-{4}-{5}.zip' -f $env:APPVEYOR_BUILD_FOLDER, $commit, $php_branch, ('nts','ts')[$env:TS], $env:CRT, $env:PLATFORM
117+
$dir = '{0}{1}\Release{2}' -f $env:APPVEYOR_BUILD_FOLDER, (&{If('x64' -eq $env:PLATFORM) {'\x64'} Else {''}}), ('','_TS')[$env:TS]
118+
119+
& 7z a $zip $dir\php_mongodb.dll $dir\php_mongodb.pdb $env:APPVEYOR_BUILD_FOLDER\LICENSE
120+
Push-AppveyorArtifact $zip
121+
122+
test_script:
123+
ps: |
124+
# Add TS part to runtime path for clarity, although it's not necessary to avoid a conflit like with devel packs
125+
$runtime_dir = 'c:\build-cache\php-{0}-{1}-{2}-{3}' -f $env:PHP_VER, ('nts','ts')[$env:TS], $env:CRT.toUpper(), $env:PLATFORM
126+
127+
if (-not (Test-Path $runtime_dir)) {
128+
$runtime_pkg = 'php-{0}{1}-Win32-{2}-{3}.zip' -f $env:PHP_VER, ('-nts','')[$env:TS], $env:CRT.toUpper(), $env:PLATFORM
129+
130+
if (-not (Test-Path c:\build-cache\$runtime_pkg)) {
131+
Invoke-WebRequest "http://windows.php.net/downloads/releases/archives/$runtime_pkg" -OutFile "c:\build-cache\$runtime_pkg"
132+
133+
# Latest versions will be in releases/ instead of releases/archives
134+
if (-not (Test-Path c:\build-cache\$runtime_pkg)) {
135+
Invoke-WebRequest "http://windows.php.net/downloads/releases/$runtime_pkg" -OutFile "c:\build-cache\$runtime_pkg"
136+
}
137+
}
138+
139+
& 7z x c:\build-cache\$runtime_pkg -o"$runtime_dir"
140+
}
141+
142+
cd $env:APPVEYOR_BUILD_FOLDER
143+
echo "" | Out-File -Encoding "ASCII" test.bat
144+
echo "set REPORT_EXIT_STATUS=1" | Out-File -Encoding "ASCII" -Append test.bat
145+
echo "set NO_INTERACTION=1" | Out-File -Encoding "ASCII" -Append test.bat
146+
echo "call configure $env:CONFIGURE_OPTS --with-prefix=$runtime_dir 2>&1" | Out-File -Encoding "ASCII" -Append test.bat
147+
echo "nmake /nologo test TESTS=--show-diff 2>&1" | Out-File -Encoding "ASCII" -Append test.bat
148+
echo "exit %errorlevel%" | Out-File -Encoding "ASCII" -Append test.bat
149+
150+
& $env:SDK_RUNNER -t $env:APPVEYOR_BUILD_FOLDER\test.bat

.appveyor/build.cmd

Lines changed: 0 additions & 15 deletions
This file was deleted.

.appveyor/build_task.cmd

Lines changed: 0 additions & 73 deletions
This file was deleted.

.appveyor/install.cmd

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)