Skip to content

Commit a8fccb3

Browse files
committed
CI: on Windows, use taskkill instead of pkill to abort Godot
1 parent c31098f commit a8fccb3

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/composite/godot-itest/action.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ runs:
157157
# * tee: still output logs while scanning for errors
158158
# * grep -q: no output, use exit code 0 if found -> thus also &&
159159
# * pkill: stop Godot execution (since it hangs in headless mode); simple 'head -1' did not work as expected
160+
# since it's not available on Windows, use taskkill in that case.
160161
# * exit: the terminated process would return 143, but this is more explicit and future-proof
161162
#
162163
# --disallow-focus: fail if #[itest(focus)] is encountered, to prevent running only a few tests for full CI
@@ -166,10 +167,14 @@ runs:
166167
$GODOT4_BIN --headless -- --disallow-focus ${{ inputs.godot-args }} 2>&1 \
167168
| tee "${{ runner.temp }}/log.txt" \
168169
| tee >(grep -E "SCRIPT ERROR:|Can't open dynamic library" -q && {
169-
printf "\n::error::godot-itest: unrecoverable Godot error, abort...\n";
170-
pkill godot
171-
echo "OUTCOME=godot-runtime" >> $GITHUB_ENV
172-
exit 2
170+
printf "\n::error::godot-itest: unrecoverable Godot error, abort...\n";
171+
if [[ "$RUNNER_OS" == "Windows" ]]; then
172+
taskkill -f -im godot*
173+
else
174+
pkill godot
175+
fi
176+
echo "OUTCOME=godot-runtime" >> $GITHUB_ENV
177+
exit 2
173178
})
174179
175180
echo "OUTCOME=success" >> $GITHUB_ENV
@@ -198,14 +203,14 @@ runs:
198203
"godot-runtime")
199204
echo "### :x: Godot runtime error" > $GITHUB_STEP_SUMMARY
200205
echo "$GODOT_BUILT_FROM" >> $GITHUB_STEP_SUMMARY
201-
echo "Aborted due to an error during Godot execution." >> $GITHUB_STEP_SUMMARY
206+
echo "Aborted due to an error during Godot execution." >> $GITHUB_STEP_SUMMARY
202207
exit 2
203208
;;
204209
205210
"godot-leak")
206211
echo "### :x: Memory leak" > $GITHUB_STEP_SUMMARY
207212
echo "$GODOT_BUILT_FROM" >> $GITHUB_STEP_SUMMARY
208-
echo "Integration tests cause memory leaks." >> $GITHUB_STEP_SUMMARY
213+
echo "Integration tests cause memory leaks." >> $GITHUB_STEP_SUMMARY
209214
exit 3
210215
;;
211216

0 commit comments

Comments
 (0)