55 windows-tests :
66 name : Unit Test on Windows
77 runs-on : windows-2022
8+ timeout-minutes : 20
89 if : " !contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[win-unit]')"
910 strategy :
1011 fail-fast : false
4950 with :
5051 ext-path : .
5152 tools-path : C:\tools\phpdev
52- conf-args : --enable-swoole-curl --enable-swoole-thread
53+ conf-args : --enable-swoole-curl --enable-swoole-thread --enable-php-sockets
5354 staging-deps : ' 1'
5455 deps : openssl,libcurl,libssh2,zlib,nghttp2,libzstd,brotli
5556
@@ -65,11 +66,158 @@ jobs:
6566 php composer-setup.php --quiet
6667 php composer.phar install --working-dir=tests\include\lib --no-interaction
6768
68- - name : Run unit tests
69+ - name : Run IOCP cURL cancellation test
70+ id : iocp-curl-cancel
71+ continue-on-error : true
72+ timeout-minutes : 1
6973 shell : cmd
7074 run : |
7175 set PHPT=1
7276 set TEST_PHP_EXECUTABLE=php
7377 set SKIP_ONLINE_TESTS=1
7478 set NO_INTERACTION=1
75- php tests\run-tests -P -q -d extension=php_swoole -d swoole.use_shortname=On --show-diff -g FAIL,BORK,LEAK,XLEAK --show-slow 1000 --set-timeout 300 tests\swoole_windows tests\swoole_function
79+ php tests\run-tests -P -q -d extension=php_swoole -d swoole.use_shortname=On --show-diff -g PASS,FAIL,BORK,LEAK,XLEAK --show-slow 1000 --set-timeout 10 tests\swoole_windows\iocp_curl_cancel.phpt
80+
81+ - name : Run core Windows IOCP tests
82+ id : windows-core
83+ continue-on-error : true
84+ timeout-minutes : 2
85+ shell : powershell
86+ run : |
87+ $tests = @(
88+ 'tests\swoole_windows\atomic_compat.phpt',
89+ 'tests\swoole_windows\bootstrap.phpt',
90+ 'tests\swoole_windows\iocp_cancel.phpt',
91+ 'tests\swoole_windows\iocp_curl.phpt',
92+ 'tests\swoole_windows\iocp_curl_multi.phpt',
93+ 'tests\swoole_windows\iocp_file.phpt',
94+ 'tests\swoole_windows\iocp_shutdown.phpt',
95+ 'tests\swoole_windows\iocp_socket.phpt',
96+ 'tests\swoole_windows\local_ip.phpt',
97+ 'tests\swoole_windows\local_mac.phpt'
98+ )
99+ & .github\workflows\windows-phpt.ps1 -Path $tests -TimeoutSeconds 12
100+
101+ - name : Run Windows function and atomic tests
102+ id : function-atomic
103+ continue-on-error : true
104+ timeout-minutes : 1
105+ shell : cmd
106+ run : |
107+ set PHPT=1
108+ set TEST_PHP_EXECUTABLE=php
109+ set SKIP_ONLINE_TESTS=1
110+ set NO_INTERACTION=1
111+ php tests\run-tests -P -q -d extension=php_swoole -d swoole.use_shortname=On --show-diff -g PASS,FAIL,BORK,LEAK,XLEAK --show-slow 1000 --set-timeout 10 tests\swoole_function tests\swoole_atomic\atomic.phpt tests\swoole_atomic\wait_and_wakeup.phpt
112+
113+ - name : Run Windows channel and lock tests
114+ id : channel-lock
115+ continue-on-error : true
116+ timeout-minutes : 2
117+ shell : cmd
118+ run : |
119+ set PHPT=1
120+ set TEST_PHP_EXECUTABLE=php
121+ set SKIP_ONLINE_TESTS=1
122+ set NO_INTERACTION=1
123+ php tests\run-tests -P -q -d extension=php_swoole -d swoole.use_shortname=On --show-diff -g PASS,FAIL,BORK,LEAK,XLEAK --show-slow 1000 --set-timeout 10 tests\swoole_channel_coro tests\swoole_coroutine_lock tests\swoole_coroutine_wait_group
124+
125+ - name : Run Windows scheduler tests
126+ id : scheduler
127+ continue-on-error : true
128+ timeout-minutes : 3
129+ shell : powershell
130+ run : |
131+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_coroutine_scheduler -TimeoutSeconds 12
132+
133+ - name : Run Windows coroutine utility tests
134+ id : coroutine-util
135+ continue-on-error : true
136+ timeout-minutes : 2
137+ shell : powershell
138+ run : |
139+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_coroutine_util -TimeoutSeconds 12
140+
141+ - name : Run Windows coroutine system tests
142+ id : coroutine-system
143+ continue-on-error : true
144+ timeout-minutes : 2
145+ shell : powershell
146+ run : |
147+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_coroutine_system -TimeoutSeconds 12
148+
149+ - name : Run Windows timer and event tests
150+ id : timer-event
151+ continue-on-error : true
152+ timeout-minutes : 2
153+ shell : cmd
154+ run : |
155+ set PHPT=1
156+ set TEST_PHP_EXECUTABLE=php
157+ set SKIP_ONLINE_TESTS=1
158+ set NO_INTERACTION=1
159+ php tests\run-tests -P -q -d extension=php_swoole -d swoole.use_shortname=On --show-diff -g PASS,FAIL,BORK,LEAK,XLEAK --show-slow 1000 --set-timeout 10 tests\swoole_timer tests\swoole_event
160+
161+ - name : Run Windows IOCP socket tests (1/4)
162+ id : iocp-socket-1
163+ continue-on-error : true
164+ timeout-minutes : 2
165+ shell : powershell
166+ run : |
167+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_socket_coro -Count 16 -TimeoutSeconds 12
168+
169+ - name : Run Windows IOCP socket tests (2/4)
170+ id : iocp-socket-2
171+ continue-on-error : true
172+ timeout-minutes : 2
173+ shell : powershell
174+ run : |
175+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_socket_coro -Offset 16 -Count 16 -TimeoutSeconds 12
176+
177+ - name : Run Windows IOCP socket tests (3/4)
178+ id : iocp-socket-3
179+ continue-on-error : true
180+ timeout-minutes : 2
181+ shell : powershell
182+ run : |
183+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_socket_coro -Offset 32 -Count 16 -TimeoutSeconds 12
184+
185+ - name : Run Windows IOCP socket tests (4/4)
186+ id : iocp-socket-4
187+ continue-on-error : true
188+ timeout-minutes : 2
189+ shell : powershell
190+ run : |
191+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_socket_coro -Offset 48 -Count 16 -TimeoutSeconds 12
192+
193+ - name : Run Windows thread tests
194+ id : thread
195+ continue-on-error : true
196+ timeout-minutes : 4
197+ shell : powershell
198+ run : |
199+ & .github\workflows\windows-phpt.ps1 -Path tests\swoole_thread\*.phpt -TimeoutSeconds 20
200+
201+ - name : Check Windows test results
202+ if : always()
203+ shell : powershell
204+ run : |
205+ $outcomes = @(
206+ '${{ steps.iocp-curl-cancel.outcome }}',
207+ '${{ steps.windows-core.outcome }}',
208+ '${{ steps.function-atomic.outcome }}',
209+ '${{ steps.channel-lock.outcome }}',
210+ '${{ steps.scheduler.outcome }}',
211+ '${{ steps.coroutine-util.outcome }}',
212+ '${{ steps.coroutine-system.outcome }}',
213+ '${{ steps.timer-event.outcome }}',
214+ '${{ steps.iocp-socket-1.outcome }}',
215+ '${{ steps.iocp-socket-2.outcome }}',
216+ '${{ steps.iocp-socket-3.outcome }}',
217+ '${{ steps.iocp-socket-4.outcome }}',
218+ '${{ steps.thread.outcome }}'
219+ )
220+ if ($outcomes -contains 'failure' -or $outcomes -contains 'cancelled') {
221+ Write-Error "One or more Windows PHPT suites failed: $($outcomes -join ', ')"
222+ exit 1
223+ }
0 commit comments