Skip to content

Commit 16aac5e

Browse files
committed
Migrate Windows CI to Github Actions I.
1 parent 16bec78 commit 16aac5e

File tree

8 files changed

+31
-39
lines changed

8 files changed

+31
-39
lines changed

.appveyor.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ skip_commits:
1111
- UPGRADING
1212
- UPGRADING.INTERNALS
1313

14-
cache:
15-
- c:\build-cache
16-
1714
environment:
1815
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
1916
PHP_BUILD_OBJ_DIR: c:\obj

.github/scripts/windows/build.bat

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,28 @@
11
@echo off
22

3+
if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" (
4+
echo for CI only
5+
exit /b 3
6+
)
7+
38
set SDK_REMOTE=https://github.com/php/php-sdk-binary-tools.git
49
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
510
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
611

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-
)
12+
mkdir "%PHP_BUILD_CACHE_BASE_DIR%"
13+
mkdir "%PHP_BUILD_OBJ_DIR%"
1614

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-
)
15+
echo Cloning remote SDK repository
16+
git clone -q --branch %SDK_BRANCH% %SDK_REMOTE% --depth 1 "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
2517

2618
for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a
2719
echo Got SDK version %GOT_SDK_VER%
2820
if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" (
2921
echo Switching to the configured SDK version %SDK_BRANCH:~8%
3022
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
23+
git -q --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin
3224
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%
25+
git -q --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
3426
)
3527

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%\.github\scripts\windows\build_task.bat
42-
if %errorlevel% neq 0 exit /b 3
43-
44-
exit /b 0
28+
cmd /c %SDK_RUNNER% -t .github\scripts\windows\build_task.bat

.github/scripts/windows/build_task.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
@echo off
22

3+
if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" (
4+
echo for CI only
5+
exit /b 3
6+
)
7+
38
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
49
if %errorlevel% neq 0 exit /b 3
510
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL

.github/scripts/windows/test.bat

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
@echo off
22

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
3+
if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" (
4+
echo for CI only
5+
exit /b 3
76
)
87

9-
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\.github\scripts\windows\test_task.bat
10-
if %errorlevel% neq 0 exit /b 3
8+
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
119

12-
exit /b 0
10+
cmd /c %SDK_RUNNER% -t .github\scripts\windows\test_task.bat

.github/scripts/windows/test_task.bat

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
@echo off
22

3+
if /i "%APPVEYOR%%GITHUB_ACTIONS%" neq "True" (
4+
echo for CI only
5+
exit /b 3
6+
)
7+
38
set NO_INTERACTION=1
49
set REPORT_EXIT_STATUS=1
510
set SKIP_IO_CAPTURE_TESTS=1
@@ -98,7 +103,7 @@ mkdir c:\tests_tmp
98103
set TEST_PHP_JUNIT=c:\junit.out.xml
99104

100105
cd "%APPVEYOR_BUILD_FOLDER%"
101-
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 %PARALLEL%"
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%"
102107

103108
set EXIT_CODE=%errorlevel%
104109

buildconf.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@echo off
2+
23
cscript /nologo /e:jscript win32\build\buildconf.js %*
34
SET PHP_BUILDCONF_PATH=%~dp0
45
copy %PHP_BUILDCONF_PATH%\win32\build\configure.bat %PHP_BUILDCONF_PATH% > nul

win32/build/configure.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
@echo off
2+
23
cscript /nologo /e:jscript configure.js %*

win32/build/phpize.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@echo off
2+
23
SET PHP_BUILDCONF_PATH=%~dp0
34
cscript /nologo /e:jscript %PHP_BUILDCONF_PATH%\script\phpize.js %*
45
IF NOT EXIST configure.bat (

0 commit comments

Comments
 (0)