Skip to content

Commit e65960e

Browse files
fix: iterate psql setup
1 parent 5ae8f18 commit e65960e

File tree

7 files changed

+25
-21
lines changed

7 files changed

+25
-21
lines changed

.github/actions/setup-windows/action.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ runs:
1818
run: |
1919
Set-Service -Name "postgresql-x64-14" -StartupType manual -Status Running
2020
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "ALTER USER postgres WITH PASSWORD 'Password12!';" }
21-
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "DROP SCHEMA IF EXISTS test;" }
22-
pwsh -Command { $env:PGPASSWORD="root"; & "$env:PGBIN\psql" -U postgres -c "CREATE SCHEMA IF NOT EXISTS test;" }
23-
- name: Setup
21+
pwsh -Command { $env:PGPASSWORD="Password12!"; & "$env:PGBIN\psql" -U postgres -c "DROP SCHEMA IF EXISTS test;" }
22+
pwsh -Command { $env:PGPASSWORD="Password12!"; & "$env:PGBIN\psql" -U postgres -c "CREATE SCHEMA IF NOT EXISTS test;" }

.github/workflows/nightly.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ jobs:
883883
ref: ${{ matrix.branch.ref }}
884884
- name: Setup
885885
uses: ./.github/actions/setup-windows
886+
- name: Environment
887+
run: ./scripts/windows/env.bat
886888
- name: Build
887889
run: ./scripts/windows/build.bat
888890
- name: Test

.github/workflows/push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ jobs:
188188
uses: actions/checkout@v4
189189
- name: Setup
190190
uses: ./.github/actions/setup-windows
191+
- name: Environment
192+
run: ./scripts/windows/env.bat
191193
- name: Build
192194
run: ./scripts/windows/build.bat
193195
- name: Test

scripts/windows/build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if not exist "%SDK_RUNNER%" (
4141
exit /b 3
4242
)
4343

44-
cmd /c %SDK_RUNNER% -t .github\scripts\windows\build_task.bat
44+
cmd /c %SDK_RUNNER% -t %WIN_SCRIPTS_DIR%\build_task.bat
4545
if %errorlevel% neq 0 exit /b 3
4646

4747
exit /b 0

scripts/windows/build_task.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if %errorlevel% neq 0 exit /b 3
1010
del /f /q C:\Windows\System32\libssl-1_1-x64.dll >NUL 2>NUL
1111
if %errorlevel% neq 0 exit /b 3
1212

13-
call %~dp0find-target-branch.bat
13+
call %WIN_SCRIPTS_DIR%\find-target-branch.bat
1414
set STABILITY=staging
1515
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
1616
rem SDK is cached, deps info is cached as well

scripts/windows/env.bat

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

3-
set PHP_BUILD_CACHE_BASE_DIR=C:\build-cache
4-
set PHP_BUILD_OBJ_DIR=C:\obj
5-
set PHP_BUILD_CACHE_SDK_DIR=C:\build-cache\sdk
6-
set PHP_BUILD_SDK_BRANCH=php_src-2.2.1-dev
7-
set PHP_BUILD_CRT=vs16
8-
set PLATFORM=x64
9-
set THREAD_SAFE=1
10-
set INTRINSICS=AVX2
11-
set PARALLEL= -j2
12-
set OPCACHE=1
3+
setx WIN_SCRIPTS_DIR %~dp0
4+
setx SCRIPT_DRIVE %~d0
135

14-
set CI=True
15-
set BRANCH=master
6+
if /i "%LOCALBUILD%" equ "True" (
7+
setx PHP_BUILD_CACHE_BASE_DIR C:\build-cache
8+
setx PHP_BUILD_OBJ_DIR C:\obj
9+
setx PHP_BUILD_CACHE_SDK_DIR C:\build-cache\sdk
10+
setx PHP_BUILD_SDK_BRANCH php_src-2.2.1-dev
11+
setx PHP_BUILD_CRT vs16
12+
setx PLATFORM x64
13+
setx THREAD_SAFE 1
14+
setx INTRINSICS AVX2
15+
setx PARALLEL -j2
16+
setx OPCACHE 1
1617

18+
setx CI True
19+
setx BRANCH master
20+
)

scripts/windows/test.bat

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@ if /i "%CI%" neq "True" (
33
exit /b 3
44
)
55

6-
set WIN_SCRIPTS_DIR=%~dp0
7-
set SCRIPT_DRIVE=%~d0
8-
96
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
107
rem SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
118
if not exist "%SDK_RUNNER%" (
129
echo "%SDK_RUNNER%" doesn't exist
1310
exit /b 3
1411
)
1512

16-
cmd /c %SDK_RUNNER% -t .github\scripts\windows\test_task.bat
13+
cmd /c %SDK_RUNNER% -t %WIN_SCRIPTS_DIR%\test_task.bat
1714
if %errorlevel% neq 0 exit /b 3
1815

1916
exit /b 0

0 commit comments

Comments
 (0)