Skip to content

Commit 3d3d29e

Browse files
committed
Migrate Windows CI to Github Actions II.
1 parent 16aac5e commit 3d3d29e

File tree

4 files changed

+128
-105
lines changed

4 files changed

+128
-105
lines changed

.appveyor.yml

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,27 @@ skip_commits:
1212
- UPGRADING.INTERNALS
1313

1414
environment:
15-
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
16-
PHP_BUILD_OBJ_DIR: c:\obj
17-
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
18-
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
19-
PHP_BUILD_CRT: vs16
20-
# ext and env setup for tests
21-
#MYSQL_TEST_PASSWD: Password12!
22-
#MYSQL_TEST_USER: root
23-
#PDO_MYSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=root password=Password12!"
24-
#PDO_MYSQL_TEST_USER: root
25-
#PDO_MYSQL_TEST_PASS: Password12!
26-
#PGSQL_TEST_CONNSTR: "host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!"
27-
#PDO_PGSQL_TEST_DSN: "pgsql:host=127.0.0.1 port=5432 dbname=test user=postgres password=Password12!"
28-
#build permutations
29-
matrix:
30-
- THREAD_SAFE: 0
31-
OPCACHE: 0
32-
PARALLEL: -j2
33-
- THREAD_SAFE: 1
34-
OPCACHE: 1
35-
PARALLEL: -j2
36-
INTRINSICS: AVX2
15+
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
16+
PHP_BUILD_OBJ_DIR: c:\obj
17+
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
18+
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
19+
PHP_BUILD_CRT: vs16
20+
matrix:
21+
- THREAD_SAFE: ""
22+
- THREAD_SAFE: 1
23+
INTRINSICS: AVX2
3724

3825
services:
39-
# the setup scripts have to be touched, once some other db version is used
40-
- mysql
41-
- postgresql101
42-
- mssql2017
26+
- mysql
27+
- postgresql101
28+
- mssql2017
4329

4430
platform:
45-
- x64
46-
#- x86
31+
- x64
32+
#- x86
4733

4834
build_script:
49-
- .github\scripts\windows\build.bat
35+
- .github\scripts\windows\build.bat
5036

5137
test_script:
52-
- .github\scripts\windows\test.bat
38+
- .github\scripts\windows\test.bat

.github/scripts/windows/build_task.bat

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,34 @@ if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" (
55
exit /b 3
66
)
77

8-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
9-
if %errorlevel% neq 0 exit /b 3
10-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
11-
if %errorlevel% neq 0 exit /b 3
12-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
13-
if %errorlevel% neq 0 exit /b 3
14-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
15-
if %errorlevel% neq 0 exit /b 3
16-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
17-
if %errorlevel% neq 0 exit /b 3
18-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL
19-
if %errorlevel% neq 0 exit /b 3
20-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL
21-
if %errorlevel% neq 0 exit /b 3
22-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL
23-
if %errorlevel% neq 0 exit /b 3
24-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL
25-
if %errorlevel% neq 0 exit /b 3
26-
if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL
27-
if %errorlevel% neq 0 exit /b 3
28-
if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
8+
if /i "%APPVEYOR%" equ "True" (
9+
rmdir /s /q C:\cygwin >NUL 2>NUL
10+
if %errorlevel% neq 0 exit /b 3
11+
rmdir /s /q C:\cygwin64 >NUL 2>NUL
12+
if %errorlevel% neq 0 exit /b 3
13+
rmdir /s /q C:\mingw >NUL 2>NUL
14+
if %errorlevel% neq 0 exit /b 3
15+
rmdir /s /q C:\mingw-w64 >NUL 2>NUL
16+
if %errorlevel% neq 0 exit /b 3
17+
rmdir /s /q C:\msys64 >NUL 2>NUL
18+
if %errorlevel% neq 0 exit /b 3
19+
rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL
20+
if %errorlevel% neq 0 exit /b 3
21+
rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL
22+
if %errorlevel% neq 0 exit /b 3
23+
rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL
24+
if %errorlevel% neq 0 exit /b 3
25+
rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL
26+
if %errorlevel% neq 0 exit /b 3
27+
)
28+
if /i "%GITHUB_ACTIONS%" equ "True" (
29+
rem rmdir takes several minutes rename instead only
30+
ren "C:\msys64" "C:\trash-msys64"
31+
if %errorlevel% neq 0 exit /b 3
32+
)
33+
del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL
2934
if %errorlevel% neq 0 exit /b 3
30-
31-
cd /D %APPVEYOR_BUILD_FOLDER%
35+
del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
3236
if %errorlevel% neq 0 exit /b 3
3337

3438
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
@@ -53,13 +57,17 @@ if %errorlevel% neq 0 exit /b 3
5357
cmd /c buildconf.bat --force
5458
if %errorlevel% neq 0 exit /b 3
5559

56-
if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
60+
if "%THREAD_SAFE%" equ "" set ADD_CONF=%ADD_CONF% --disable-zts
5761
if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
5862

5963
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_firebird,ldap,imap,ftp
60-
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
64+
if "%OPCACHE%" equ "" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
6165

62-
set CFLAGS=/W1 /WX
66+
if "%PLATFORM%" == "x86" (
67+
set CFLAGS=/W1
68+
) else (
69+
set CFLAGS=/W1 /WX
70+
)
6371

6472
cmd /c configure.bat ^
6573
--enable-snapshot-build ^
@@ -72,7 +80,4 @@ cmd /c configure.bat ^
7280
--with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST%
7381
if %errorlevel% neq 0 exit /b 3
7482

75-
nmake /NOLOGO
76-
if %errorlevel% neq 0 exit /b 3
77-
78-
exit /b 0
83+
nmake /NOLOGO /S

.github/scripts/windows/test_task.bat

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,47 @@ if not exist "%DEPS_DIR%" (
2222
exit /b 3
2323
)
2424

25-
rem setup MySQL related exts
26-
set MYSQL_PWD=Password12!
27-
set MYSQL_TEST_PASSWD=%MYSQL_PWD%
28-
set MYSQL_TEST_USER=root
29-
set MYSQL_TEST_HOST=127.0.0.1
30-
set MYSQL_TEST_PORT=3306
31-
set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER%
32-
set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
33-
set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
34-
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
35-
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test
36-
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
37-
if %errorlevel% neq 0 exit /b 3
38-
39-
rem setup PostgreSQL related exts
40-
set PGUSER=postgres
41-
set PGPASSWORD=Password12!
42-
rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!
43-
echo ^<?php $conn_str = "host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD%"; ?^> >> "./ext/pgsql/tests/config.inc"
44-
set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD%
45-
"C:\Program Files\PostgreSQL\10\bin\createdb.exe" test
46-
if %errorlevel% neq 0 exit /b 3
47-
48-
rem setup ODBC related exts
49-
set ODBC_TEST_USER=sa
50-
set ODBC_TEST_PASS=Password12!
51-
set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=(local)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS%
52-
set PDOTEST_DSN=odbc:%ODBC_TEST_DSN%
25+
if /i "%APPVEYOR%" equ "True" (
26+
rem setup MySQL related exts
27+
set MYSQL_PWD=Password12!
28+
set MYSQL_TEST_PASSWD=%MYSQL_PWD%
29+
set MYSQL_TEST_USER=root
30+
set MYSQL_TEST_HOST=127.0.0.1
31+
set MYSQL_TEST_PORT=3306
32+
set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER%
33+
set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
34+
set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
35+
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
36+
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test
37+
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
38+
if %errorlevel% neq 0 exit /b 3
39+
40+
rem setup PostgreSQL related exts
41+
set PGUSER=postgres
42+
set PGPASSWORD=Password12!
43+
rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres password=Password12!
44+
echo ^<?php $conn_str = "host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD%"; ?^> >> ext\pgsql\tests\config.inc
45+
set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD%
46+
"C:\Program Files\PostgreSQL\10\bin\createdb.exe" test
47+
if %errorlevel% neq 0 exit /b 3
48+
49+
rem setup ODBC related exts
50+
set ODBC_TEST_USER=sa
51+
set ODBC_TEST_PASS=Password12!
52+
set ODBC_TEST_DSN=Driver={ODBC Driver 13 for SQL Server};Server=^(local^)\SQL2017;Database=master;uid=%ODBC_TEST_USER%;pwd=%ODBC_TEST_PASS%
53+
set PDOTEST_DSN=odbc:%ODBC_TEST_DSN%
54+
)
5355

5456
rem prepare for ext/openssl
55-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL
56-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL
57-
if "%PLATFORM%" == "x64" (
58-
set OPENSSLDIR="C:\Program Files\Common Files\SSL"
59-
) else (
57+
rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL
58+
rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL
59+
if "%PLATFORM%" == "x86" (
6060
set OPENSSLDIR="C:\Program Files (x86)\Common Files\SSL"
61+
) else (
62+
set OPENSSLDIR="C:\Program Files\Common Files\SSL"
63+
)
64+
if /i "%GITHUB_ACTIONS%" equ "True" (
65+
rmdir /s /q %OPENSSLDIR% >NUL 2>NUL
6166
)
6267
mkdir %OPENSSLDIR%
6368
if %errorlevel% neq 0 exit /b 3
@@ -68,7 +73,7 @@ set OPENSSL_CONF=
6873
rem set SSLEAY_CONF=
6974

7075
rem prepare for Opcache
71-
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M
76+
if "%OPCACHE%" neq "" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.protect_memory=1 -d opcache.jit_buffer_size=16M
7277

7378
rem prepare for enchant
7479
mkdir C:\usr\local\lib\enchant-2
@@ -94,19 +99,14 @@ if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\en_US.aff" (
9499
mkdir %LOCALAPPDATA%\enchant\hunspell
95100
copy %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%\* %LOCALAPPDATA%\enchant\hunspell
96101

97-
set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_OBJ_DIR%\Release
98-
if "%THREAD_SAFE%" equ "1" set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%_TS
99-
set TEST_PHPDBG_EXECUTABLE=%TEST_PHPDBG_EXECUTABLE%\phpdbg.exe
102+
set PHP_BUILD_DIR=%PHP_BUILD_OBJ_DIR%\Release
103+
if "%THREAD_SAFE%" neq "" set PHP_BUILD_DIR=%PHP_BUILD_DIR%_TS
104+
105+
set TEST_PHPDBG_EXECUTABLE=%PHP_BUILD_DIR%\phpdbg.exe
100106

101107
mkdir c:\tests_tmp
102108

103109
set TEST_PHP_JUNIT=c:\junit.out.xml
104110

105-
cd "%APPVEYOR_BUILD_FOLDER%"
106-
nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp %PARALLEL%"
107-
108-
set EXIT_CODE=%errorlevel%
109-
110-
appveyor PushArtifact %TEST_PHP_JUNIT%
111-
112-
exit /b %EXIT_CODE%
111+
nmake test TESTS="%OPCACHE_OPTS% -q --offline -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP --color --show-diff --show-slow 1000 --set-timeout 120 --temp-source c:\tests_tmp --temp-target c:\tests_tmp -j2"
112+
if %errorlevel% neq 0 exit /b %errorlevel%

.github/workflows/push.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,35 @@ jobs:
131131
-d opcache.jit_buffer_size=16M
132132
- name: Verify generated files are up to date
133133
uses: ./.github/actions/verify-generated-files
134+
WINDOWS_X64:
135+
strategy:
136+
fail-fast: false
137+
matrix:
138+
include:
139+
- x64: true
140+
zts: false
141+
- x64: true
142+
zts: true
143+
- x64: false
144+
zts: false
145+
name: "WINDOWS_${{ matrix.x64 && 'X64' || 'X86' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
146+
runs-on: windows-2019
147+
env:
148+
APPVEYOR_REPO_BRANCH: "${{ github.ref_name }}"
149+
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
150+
PHP_BUILD_OBJ_DIR: c:\obj
151+
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
152+
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
153+
PHP_BUILD_CRT: vs16
154+
PLATFORM: ${{ matrix.x64 && 'x64' || 'x86' }}
155+
THREAD_SAFE: "${{ matrix.zts && '1' || '' }}"
156+
INTRINSICS: "${{ matrix.zts && 'AVX2' || '' }}"
157+
steps:
158+
- name: git checkout 1/2
159+
run: git config --global core.autocrlf false && git config --global core.eol lf
160+
- name: git checkout 2/2
161+
uses: actions/checkout@v2
162+
- name: Build
163+
run: .github/scripts/windows/build.bat
164+
- name: Test
165+
run: .github/scripts/windows/test.bat

0 commit comments

Comments
 (0)