diff --git a/.github/scripts/windows/build.bat b/.github/scripts/windows/build.bat index 65f40fb9462a7..41bcc9b558fed 100644 --- a/.github/scripts/windows/build.bat +++ b/.github/scripts/windows/build.bat @@ -41,7 +41,7 @@ if not exist "%SDK_RUNNER%" ( exit /b 3 ) -cmd /c %SDK_RUNNER% -t .github\scripts\windows\build_task.bat +cmd /c %SDK_RUNNER% -t .github\scripts\windows\build_task.bat --task-args %1 if %errorlevel% neq 0 exit /b 3 exit /b 0 diff --git a/.github/scripts/windows/build_task.bat b/.github/scripts/windows/build_task.bat index e8d84b8c0bfd6..c08e8f1919c13 100644 --- a/.github/scripts/windows/build_task.bat +++ b/.github/scripts/windows/build_task.bat @@ -5,12 +5,13 @@ if /i "%GITHUB_ACTIONS%" neq "True" ( exit /b 3 ) +set BRANCH=%1 + del /f /q C:\Windows\System32\libcrypto-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL if %errorlevel% neq 0 exit /b 3 -call %~dp0find-target-branch.bat set STABILITY=staging set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH% rem SDK is cached, deps info is cached as well diff --git a/.github/scripts/windows/find-target-branch.bat b/.github/scripts/windows/find-target-branch.bat index a0b47f2488946..adf89071b7330 100644 --- a/.github/scripts/windows/find-target-branch.bat +++ b/.github/scripts/windows/find-target-branch.bat @@ -6,3 +6,5 @@ for /f "usebackq tokens=3" %%i in (`findstr PHP_MINOR_VERSION main\php_version.h if /i "%BRANCH%" equ "8.5" ( set BRANCH=master ) + +echo branch=%BRANCH%>> %GITHUB_OUTPUT% diff --git a/.github/scripts/windows/test.bat b/.github/scripts/windows/test.bat index 1a24564697219..ed4bb7f0f04f9 100644 --- a/.github/scripts/windows/test.bat +++ b/.github/scripts/windows/test.bat @@ -9,7 +9,7 @@ if not exist "%SDK_RUNNER%" ( exit /b 3 ) -cmd /c %SDK_RUNNER% -t .github\scripts\windows\test_task.bat +cmd /c %SDK_RUNNER% -t .github\scripts\windows\test_task.bat --task-args %1 if %errorlevel% neq 0 exit /b 3 exit /b 0 diff --git a/.github/scripts/windows/test_task.bat b/.github/scripts/windows/test_task.bat index b719d288e6688..59b8044f243ea 100644 --- a/.github/scripts/windows/test_task.bat +++ b/.github/scripts/windows/test_task.bat @@ -3,16 +3,12 @@ if /i "%GITHUB_ACTIONS%" neq "True" ( exit /b 3 ) +set BRANCH=%1 + set NO_INTERACTION=1 set REPORT_EXIT_STATUS=1 set SKIP_IO_CAPTURE_TESTS=1 -call %~dp0find-target-branch.bat -if "%BRANCH%" neq "master" ( - set STABILITY=stable -) else ( - set STABILITY=staging -) set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH% if not exist "%DEPS_DIR%" ( echo "%DEPS_DIR%" doesn't exist diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d014047d150c7..46add90c97919 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -247,10 +247,18 @@ jobs: uses: actions/checkout@v4 - name: Setup uses: ./.github/actions/setup-windows + - name: Find target branch + id: branch + run: .github/scripts/windows/find-target-branch.bat + - name: Cache + uses: actions/cache@v4 + with: + key: ${{ env.PHP_BUILD_SDK_BRANCH }}-deps-${{ steps.branch.outputs.branch }}-${{ env.PHP_BUILD_CRT }}-${{ env.PLATFORM }} + path: ${{ env.PHP_BUILD_CACHE_BASE_DIR }} - name: Build - run: .github/scripts/windows/build.bat + run: .github/scripts/windows/build.bat ${{ steps.branch.outputs.branch }} - name: Test - run: .github/scripts/windows/test.bat + run: .github/scripts/windows/test.bat ${{ steps.branch.outputs.branch }} BENCHMARKING: name: BENCHMARKING if: github.repository == 'php/php-src' || github.event_name == 'pull_request'