@@ -123,8 +123,10 @@ jobs:
123123 shell : bash
124124 run : |
125125 if [[ "${{ runner.os }}" == "Windows" ]]; then
126- cmd.exe /c "start /b .\dist\${{ matrix.output }} --no-printers > startup.log 2>&1"
126+ # Windows: Start process without log redirection (Git Bash doesn't handle it well)
127+ start /b "" ".\dist\${{ matrix.output }}" --no-printers
127128 else
129+ # Linux/macOS: Start with full log redirection
128130 chmod +x dist/${{ matrix.output }}
129131 ./dist/${{ matrix.output }} --no-printers > startup.log 2>&1 &
130132 echo $! > binary.pid
@@ -139,20 +141,29 @@ jobs:
139141 if : matrix.can_execute == true
140142 shell : bash
141143 run : |
142- if grep -iE "\[Error\]|\[Fatal\]|exception" startup.log; then
143- echo "::error::Errors detected during startup"
144- cat startup.log
145- exit 1
146- fi
144+ if [[ "${{ runner.os }}" == "Windows" ]]; then
145+ # Windows: Check if process is running via tasklist
146+ if ! tasklist /FI "imagename eq ${{ matrix.output }}" | findstr "${{ matrix.output }}"; then
147+ echo "::error::Binary process is not running"
148+ exit 1
149+ fi
150+ echo "✓ Process is running"
151+ else
152+ # Linux/macOS: Validate log file contents
153+ if grep -iE "\[Error\]|\[Fatal\]|exception" startup.log; then
154+ echo "::error::Errors detected during startup"
155+ cat startup.log
156+ exit 1
157+ fi
147158
148- if ! grep -q "\[Ready\] FlashForgeWebUI is ready" startup.log; then
149- echo "::error::Startup did not complete - missing ready marker"
150- tail -n 50 startup.log
151- exit 1
159+ if ! grep -q "\[Ready\] FlashForgeWebUI is ready" startup.log; then
160+ echo "::error::Startup did not complete - missing ready marker"
161+ tail -n 50 startup.log
162+ exit 1
163+ fi
164+ echo "✓ Startup successful"
152165 fi
153166
154- echo "✓ Startup successful"
155-
156167 - name : Test API endpoints
157168 if : matrix.can_execute == true
158169 shell : bash
@@ -187,8 +198,10 @@ jobs:
187198 shell : bash
188199 run : |
189200 if [[ "${{ runner.os }}" == "Windows" ]]; then
190- powershell -Command "Stop-Process -Name '${{ matrix.output }}' -Force -ErrorAction SilentlyContinue"
201+ # Windows: Kill process by executable name using taskkill
202+ taskkill /F /IM "${{ matrix.output }}" 2>/dev/null || true
191203 else
204+ # Linux/macOS: Use PID file
192205 if [ -f binary.pid ]; then
193206 kill -TERM $(cat binary.pid) || true
194207 rm binary.pid
@@ -202,8 +215,13 @@ jobs:
202215 shell : bash
203216 run : |
204217 if [[ "${{ runner.os }}" == "Windows" ]]; then
205- powershell -Command "if (Get-Process -Name '${{ matrix.output }}' -ErrorAction SilentlyContinue) { exit 1 }"
218+ # Windows: Check process is gone via tasklist
219+ if tasklist /FI "imagename eq ${{ matrix.output }}" | findstr "${{ matrix.output }}"; then
220+ echo "::error::Binary left zombie processes"
221+ exit 1
222+ fi
206223 else
224+ # Linux/macOS: Use pgrep
207225 if pgrep -f "${{ matrix.output }}"; then
208226 echo "::error::Binary left zombie processes"
209227 exit 1
0 commit comments