Skip to content

Commit b1e19aa

Browse files
committed
Migrate Windows CI to Github Actions
1 parent df4c276 commit b1e19aa

File tree

5 files changed

+285
-253
lines changed

5 files changed

+285
-253
lines changed

.github/workflows/push.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ on:
1414
- PHP-8.0
1515
- PHP-8.1
1616
- master
17+
- '**.cipush'
1718
pull_request:
1819
branches:
1920
- '**'
2021
jobs:
2122
LINUX_X64:
23+
# DEBUG
24+
if: false
2225
strategy:
2326
fail-fast: false
2427
matrix:
@@ -58,6 +61,8 @@ jobs:
5861
-d opcache.enable_cli=1
5962
-d opcache.jit_buffer_size=16M
6063
MACOS_DEBUG_NTS:
64+
# DEBUG
65+
if: false
6166
runs-on: macos-10.15
6267
steps:
6368
- name: git checkout
@@ -84,3 +89,28 @@ jobs:
8489
-d opcache.enable_cli=1
8590
-d opcache.protect_memory=1
8691
-d opcache.jit_buffer_size=16M
92+
WINDOWS_XX:
93+
runs-on: windows-2019
94+
env:
95+
APPVEYOR: ""
96+
APPVEYOR_BUILD_FOLDER: "${{ github.workspace }}"
97+
APPVEYOR_REPO_BRANCH: "${{ github.ref_name }}"
98+
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
99+
PHP_BUILD_OBJ_DIR: c:\obj
100+
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
101+
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0
102+
PHP_BUILD_CRT: vs16
103+
PLATFORM: x64
104+
THREAD_SAFE: 0
105+
OPCACHE: 1
106+
PARALLEL: -j2
107+
INTRINSICS: AVX
108+
steps:
109+
- name: git checkout
110+
uses: actions/checkout@v2
111+
- name: DEBUG list env
112+
run: gci env:* | sort-object name
113+
- name: build
114+
run: appveyor/build.bat
115+
- name: test
116+
run: appveyor/test.bat

appveyor/build.bat

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
@echo off
2-
3-
set SDK_REMOTE=https://github.com/php/php-sdk-binary-tools.git
4-
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
5-
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
6-
7-
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
8-
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
9-
mkdir "%PHP_BUILD_CACHE_BASE_DIR%"
10-
)
11-
12-
if not exist "%PHP_BUILD_OBJ_DIR%" (
13-
echo Creating %PHP_BUILD_OBJ_DIR%
14-
mkdir "%PHP_BUILD_OBJ_DIR%"
15-
)
16-
17-
if not exist "%SDK_RUNNER%" (
18-
if exist "%PHP_BUILD_CACHE_SDK_DIR%" rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%"
19-
)
20-
21-
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
22-
echo Cloning remote SDK repository
23-
git clone --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
24-
)
25-
26-
for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a
27-
echo Got SDK version %GOT_SDK_VER%
28-
if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" (
29-
echo Switching to the configured SDK version %SDK_BRANCH:~8%
30-
echo Fetching remote SDK repository
31-
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
32-
echo Checkout SDK repository branch
33-
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
34-
)
35-
36-
if not exist "%SDK_RUNNER%" (
37-
echo "%SDK_RUNNER%" doesn't exist
38-
exit /b 3
39-
)
40-
41-
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
42-
if %errorlevel% neq 0 exit /b 3
43-
44-
exit /b 0
1+
@echo on
2+
3+
set SDK_REMOTE=https://github.com/php/php-sdk-binary-tools.git
4+
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
5+
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
6+
7+
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
8+
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
9+
mkdir "%PHP_BUILD_CACHE_BASE_DIR%"
10+
)
11+
12+
if not exist "%PHP_BUILD_OBJ_DIR%" (
13+
echo Creating %PHP_BUILD_OBJ_DIR%
14+
mkdir "%PHP_BUILD_OBJ_DIR%"
15+
)
16+
17+
if not exist "%SDK_RUNNER%" (
18+
if exist "%PHP_BUILD_CACHE_SDK_DIR%" rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%"
19+
)
20+
21+
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
22+
echo Cloning remote SDK repository
23+
git clone --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
24+
)
25+
26+
for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a
27+
echo Got SDK version %GOT_SDK_VER%
28+
if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" (
29+
echo Switching to the configured SDK version %SDK_BRANCH:~8%
30+
echo Fetching remote SDK repository
31+
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
32+
echo Checkout SDK repository branch
33+
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
34+
)
35+
36+
if not exist "%SDK_RUNNER%" (
37+
echo "%SDK_RUNNER%" doesn't exist
38+
exit /b 3
39+
)
40+
41+
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
42+
if %errorlevel% neq 0 exit /b 3
43+
44+
exit /b 0

appveyor/build_task.bat

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
@echo off
2-
3-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
4-
if %errorlevel% neq 0 exit /b 3
5-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
6-
if %errorlevel% neq 0 exit /b 3
7-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
8-
if %errorlevel% neq 0 exit /b 3
9-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
10-
if %errorlevel% neq 0 exit /b 3
11-
if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
12-
if %errorlevel% neq 0 exit /b 3
13-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL
14-
if %errorlevel% neq 0 exit /b 3
15-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL
16-
if %errorlevel% neq 0 exit /b 3
17-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL
18-
if %errorlevel% neq 0 exit /b 3
19-
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL
20-
if %errorlevel% neq 0 exit /b 3
21-
if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL
22-
if %errorlevel% neq 0 exit /b 3
23-
if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
24-
if %errorlevel% neq 0 exit /b 3
25-
26-
cd /D %APPVEYOR_BUILD_FOLDER%
27-
if %errorlevel% neq 0 exit /b 3
28-
29-
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
30-
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
31-
) else (
32-
set BRANCH=master
33-
)
34-
set STABILITY=staging
35-
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
36-
rem SDK is cached, deps info is cached as well
37-
echo Updating dependencies in %DEPS_DIR%
38-
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
39-
if %errorlevel% neq 0 exit /b 3
40-
41-
rem Something went wrong, most likely when concurrent builds were to fetch deps
42-
rem updates. It might be, that some locking mechanism is needed.
43-
if not exist "%DEPS_DIR%" (
44-
cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
45-
)
46-
if %errorlevel% neq 0 exit /b 3
47-
48-
cmd /c buildconf.bat --force
49-
if %errorlevel% neq 0 exit /b 3
50-
51-
if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
52-
if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
53-
54-
set CFLAGS=/W1 /WX
55-
56-
cmd /c configure.bat ^
57-
--enable-snapshot-build ^
58-
--disable-debug-pack ^
59-
--enable-com-dotnet=shared ^
60-
--without-analyzer ^
61-
--enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^
62-
--with-php-build=%DEPS_DIR% ^
63-
%ADD_CONF% ^
64-
--disable-test-ini
65-
if %errorlevel% neq 0 exit /b 3
66-
67-
nmake /NOLOGO
68-
if %errorlevel% neq 0 exit /b 3
69-
70-
exit /b 0
1+
@echo on
2+
3+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
4+
if %errorlevel% neq 0 exit /b 3
5+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
6+
if %errorlevel% neq 0 exit /b 3
7+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
8+
if %errorlevel% neq 0 exit /b 3
9+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
10+
if %errorlevel% neq 0 exit /b 3
11+
if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
12+
if %errorlevel% neq 0 exit /b 3
13+
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win32 >NUL 2>NUL
14+
if %errorlevel% neq 0 exit /b 3
15+
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-Win64 >NUL 2>NUL
16+
if %errorlevel% neq 0 exit /b 3
17+
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win32 >NUL 2>NUL
18+
if %errorlevel% neq 0 exit /b 3
19+
if "%APPVEYOR%" equ "True" rmdir /s /q c:\OpenSSL-v11-Win64 >NUL 2>NUL
20+
if %errorlevel% neq 0 exit /b 3
21+
if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL
22+
if %errorlevel% neq 0 exit /b 3
23+
if "%APPVEYOR%" equ "True" del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
24+
if %errorlevel% neq 0 exit /b 3
25+
26+
cd /D %APPVEYOR_BUILD_FOLDER%
27+
if %errorlevel% neq 0 exit /b 3
28+
29+
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
30+
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
31+
) else (
32+
set BRANCH=master
33+
)
34+
set STABILITY=staging
35+
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
36+
rem SDK is cached, deps info is cached as well
37+
echo Updating dependencies in %DEPS_DIR%
38+
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
39+
if %errorlevel% neq 0 exit /b 3
40+
41+
rem Something went wrong, most likely when concurrent builds were to fetch deps
42+
rem updates. It might be, that some locking mechanism is needed.
43+
if not exist "%DEPS_DIR%" (
44+
cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
45+
)
46+
if %errorlevel% neq 0 exit /b 3
47+
48+
cmd /c buildconf.bat --force
49+
if %errorlevel% neq 0 exit /b 3
50+
51+
if "%THREAD_SAFE%" equ "0" set ADD_CONF=%ADD_CONF% --disable-zts
52+
if "%INTRINSICS%" neq "" set ADD_CONF=%ADD_CONF% --enable-native-intrinsics=%INTRINSICS%
53+
54+
set CFLAGS=/W1 /WX
55+
56+
cmd /c configure.bat ^
57+
--enable-snapshot-build ^
58+
--disable-debug-pack ^
59+
--enable-com-dotnet=shared ^
60+
--without-analyzer ^
61+
--enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^
62+
--with-php-build=%DEPS_DIR% ^
63+
%ADD_CONF% ^
64+
--disable-test-ini
65+
if %errorlevel% neq 0 exit /b 3
66+
67+
nmake /NOLOGO
68+
if %errorlevel% neq 0 exit /b 3
69+
70+
exit /b 0

appveyor/test.bat

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

0 commit comments

Comments
 (0)